Changeset 4180 for trunk/psLib/src/sysUtils/psLogMsg.c
- Timestamp:
- Jun 8, 2005, 8:12:31 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sysUtils/psLogMsg.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sysUtils/psLogMsg.c
r4162 r4180 3 3 * \ingroup LogTrace 4 4 * 5 * This file will hold the prototypes for defining procedure which set6 * message log levels, messahe log formats, message log destinations, and7 * for generating the messagesthemselves.5 * This file contains code for setting message log levels, message log 6 * formats, message log destinations, and for generating the messages 7 * themselves. 8 8 * @ingroup LogTrace 9 9 * 10 10 * @author Robert Lupton, Princeton University 11 * @author G eorge Gusciora, MHPCC11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.4 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-06-0 8 23:40:45$13 * @version $Revision: 1.41 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-06-09 06:12:31 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 61 61 level (psS32): the new log level. 62 62 Output: 63 none64 Return:65 63 The old log level. 66 64 *****************************************************************************/ … … 82 80 83 81 /***************************************************************************** 84 psLogSetDestination(): sets the destination where log messages will be 85 sent to. 86 82 psLogSetDestination(): sets the log message destination. 87 83 Input: 88 84 dest (psS32): the new log destination 89 Output:90 None.91 85 Return: 92 An integer specifying the old log destination.86 An psBool: TRUE if successful. 93 87 *****************************************************************************/ 94 88 psBool psLogSetDestination(const char *dest) … … 132 126 return true; 133 127 } 134 psError(PS_ERR_LOCATION_INVALID, true, 135 PS_ERRORTEXT_psLogMsg_DEST_LOCATION_INVALID, 128 psError(PS_ERR_LOCATION_INVALID, true, PS_ERRORTEXT_psLogMsg_DEST_LOCATION_INVALID, 136 129 location); 137 130 return 1; … … 140 133 141 134 if (file == NULL) { 142 psError(PS_ERR_IO, true, 143 PS_ERRORTEXT_psLogMsg_OPEN_FILE_FAILED, 135 psError(PS_ERR_IO, true, PS_ERRORTEXT_psLogMsg_OPEN_FILE_FAILED, 144 136 location); 145 137 return false; … … 152 144 } 153 145 154 psError(PS_ERR_LOCATION_INVALID, true, 155 PS_ERRORTEXT_psLogMsg_UNSUPPORTED_PROTOCOL, 146 psError(PS_ERR_LOCATION_INVALID, true, PS_ERRORTEXT_psLogMsg_UNSUPPORTED_PROTOCOL, 156 147 protocol); 157 148 return false; … … 168 159 Input: 169 160 fmt: a string specifying the format. 170 Output:171 none.172 161 Return: 173 162 NULL. … … 175 164 void psLogSetFormat(const char *fmt) 176 165 { 177 // assume no thing desired unless specified166 // assume none. 178 167 logHost = false; 179 168 logLevel = false; … … 187 176 } 188 177 178 // XXX: What is the purpose of this conditional. 189 179 if (strlen(fmt) == 0) { 190 180 fmt = "THLNM"; 191 181 } 192 182 // Step through each character in the format string. For each letter 193 // in that string, set /unsetthe appropriate logging.183 // in that string, set the appropriate logging. 194 184 195 185 for (const char *ptr = fmt; *ptr != '\0'; ptr++) { … … 222 212 } 223 213 214 // XXX: If one must at least log error messages, why don't we set logMsg = true here? 224 215 if (!logMsg) { 225 216 psTrace("utils.logMsg", 1, "You must at least log error messages (You chose \"%s\")", fmt); … … 232 223 233 224 /***************************************************************************** 234 psVLogMsg(): This routine sends the message, which is a printf style 235 string specified in the "..." argument, to the current message log 236 destination with the severity specified by the "level" argument. 237 Input: 238 name 239 level 240 fmt 241 ap 242 Output: 243 none 244 Return: 245 NULL. 225 psVLogMsg(): This routine sends the message, which is a printf style string 226 specified in the "..." argument, to the current message log destination with 227 the severity specified by the "level" argument. 228 Input: 229 name 230 level 231 fmt 232 ap 246 233 *****************************************************************************/ 247 234 void psLogMsgV(const char *name, psS32 level, const char *fmt, va_list ap) … … 361 348 362 349 /***************************************************************************** 363 psLogMsg(): This routine sends the message, which is a printf style 364 string specified in the "..." argument, to the current message log 365 destination withthe severity specified by the "level" argument.366 Input:367 name: Indicates the source of this log message. 368 level: The severityof this log message.369 fmt: The printf-stype formatted string, followed by the arguments370 to that string.371 ... The arguments to the above printf-stylestring.372 Output:373 none374 Return:375 NULL350 psLogMsg(): This routine sends the message, which is a printf style string 351 specified in the "..." argument, to the current message log destination with 352 the severity specified by the "level" argument. 353 354 Input: 355 name: Indicates the source of this log message. 356 level: The severity of this log message. 357 fmt: The printf-stype formatted string, followed by the arguments 358 to that string. 359 ... The arguments to the above printf-style string. 360 361 Return: 362 NULL 376 363 *****************************************************************************/ 377 364 void psLogMsg(const char *name, psS32 level, const char *fmt, ...)
Note:
See TracChangeset
for help on using the changeset viewer.
