Changeset 5072 for trunk/psLib/src/sys
- Timestamp:
- Sep 19, 2005, 4:43:53 PM (21 years ago)
- Location:
- trunk/psLib/src/sys
- Files:
-
- 2 edited
-
psLogMsg.c (modified) (9 diffs)
-
psLogMsg.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psLogMsg.c
r4979 r5072 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.5 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-09- 09 01:11:22$14 * @version $Revision: 1.52 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-09-20 02:43:53 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 51 51 52 52 static FILE *logDest = (FILE *) 1; // flag to initialize to stderr before using. 53 static int logFD = 0; 53 54 static psS32 globalLogLevel = PS_LOG_INFO; // log all messages at this or above 54 55 static psBool logTime = true; // Flag to include time info … … 81 82 } 82 83 84 int psLogGetLevel() 85 { 86 return (globalLogLevel); 87 } 88 83 89 /***************************************************************************** 84 90 psLogSetDestination(): sets the log message destination. … … 94 100 if (logDest == (FILE *) 1) { 95 101 logDest = stderr; 102 logFD = 2; 96 103 } 97 104 if (fd == -1) … … 104 111 } 105 112 logDest = stdout; 113 logFD = 1; 106 114 } else if (fd == 2) { 107 115 // fp = stderr; … … 110 118 } 111 119 logDest = stderr; 120 logFD = 2; 112 121 } else if (fd == 0) { 113 122 // fp = NULL; … … 116 125 } 117 126 logDest = NULL; 127 logFD = 0; 118 128 // return true; 119 129 } else if (fd > 2) { … … 123 133 fp = fdopen(fd, "w"); 124 134 logDest = fp; 135 logFD = fd; 125 136 // fclose(fp); 126 137 // return true; … … 130 141 131 142 } 143 144 int psLogGetDestination(void) 145 { 146 if (logDest == (FILE *) 1) { 147 logFD = 1; 148 } 149 return (logFD); 150 } 151 132 152 133 153 /***************************************************************************** -
trunk/psLib/src/sys/psLogMsg.h
r5057 r5072 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.3 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-09- 15 21:22:22$13 * @version $Revision: 1.34 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-09-20 02:43:53 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 36 36 ); 37 37 38 /** This procedure returns the current log destination file descriptor. If the 39 * destination has not been defined by the use, the descriptor for stdout is returned. 40 * 41 * @return int: The current file descriptor. 42 */ 43 int psLogGetDestination(); 44 38 45 /** This procedure sets the message level for future log messages. Subsequent 39 46 * log messages, with a log level of "mylevel", will only be logged if … … 42 49 * be displayed. The old log level will be returned. 43 50 * 44 * @return int old logging level51 * @return int: old logging level. 45 52 */ 46 53 int psLogSetLevel( 47 54 int level ///< Specifies the system log level 48 55 ); 56 57 /** This procedures returns the current log message level. 58 * 59 * @return int: The current logging level. 60 */ 61 int psLogGetLevel(); 49 62 50 63 /** This procedure sets the log format for future log messages. The argument
Note:
See TracChangeset
for help on using the changeset viewer.
