Changeset 1448 for trunk/psLib/src/sys/psLogMsg.h
- Timestamp:
- Aug 9, 2004, 3:55:34 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psLogMsg.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psLogMsg.h
r1441 r1448 12 12 * @author George Gusciora, MHPCC 13 13 * 14 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08- 09 23:40:55$14 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-10 01:55:34 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 20 20 #define PS_LOG_MSG_H 21 21 #include <stdarg.h> 22 #include <stdbool.h> 22 23 23 24 /** @addtogroup LogTrace … … 25 26 */ 26 27 27 /// This procedure sets the destination for future log messages. Currently 28 /// the destination is specified by an integer which can have the following 29 /// pre-defined values: PS_LOG_NONE, PS_LOG_TO_STDOUT, and PS_LOG_TO_STDERR. 30 /// In future versions, this procedure will take a character string as an 31 /// argument which can specify more general log destinations. 32 int psLogSetDestination(const char *dest ///< Specifies where to send messages. 33 ); 28 /** This procedure sets the destination for future log messages. Currently 29 * the destination is specified by an integer which can have the following 30 * pre-defined values: PS_LOG_NONE, PS_LOG_TO_STDOUT, and PS_LOG_TO_STDERR. 31 * In future versions, this procedure will take a character string as an 32 * argument which can specify more general log destinations. 33 * 34 * @return int true if set successfully, otherwise false. 35 */ 36 bool psLogSetDestination( 37 const char *dest ///< Specifies where to send messages. 38 ); 34 39 35 /// This procedure sets the message level for future log messages. Subsequent 36 /// log messages, with a log level of "mylevel", will only be logged if 37 /// "mylevel" is less than the current log level set by this procedure. 38 /// Ie. higher values set by this procedure will cause more log messages to 39 /// be displayed. 40 int psLogSetLevel(int level ///< Specifies the system log level 41 ); 40 /** This procedure sets the message level for future log messages. Subsequent 41 * log messages, with a log level of "mylevel", will only be logged if 42 * "mylevel" is less than the current log level set by this procedure. 43 * Ie. higher values set by this procedure will cause more log messages to 44 * be displayed. 45 * 46 * @return int old logging level 47 */ 48 int psLogSetLevel( 49 int level ///< Specifies the system log level 50 ); 42 51 43 /// This procedure sets the log format for future log messages. The argument 44 /// must be a character string consistsing of the letters H (host), L 45 /// (level), M (message), N (name), and T (time). The default is "THLNM". 46 /// Deleting a letter from the string will cause the associated information 47 /// to not be logged. 48 void psLogSetFormat(const char *fmt ///< Specifies the system log format 49 ); 52 /** This procedure sets the log format for future log messages. The argument 53 * must be a character string consistsing of the letters H (host), L 54 * (level), M (message), N (name), and T (time). The default is "THLNM". 55 * Deleting a letter from the string will cause the associated information 56 * to not be logged. 57 * 58 */ 59 void psLogSetFormat( 60 const char *fmt ///< Specifies the system log format 61 ); 50 62 51 /// This procedure logs a message to the destination set by a prior 52 /// call to psLogSetDestination(), if myLevel is less than the level 53 /// specified by a prior call to psLogSetLevel(). The message is specified 54 /// with a printf-stype string an arguments. 55 void psLogMsg(const char *name, ///< name of the log source 56 int myLevel, ///< severity level of this log message 57 const char *fmt, ... ///< printf-style format command 58 ); 63 /** This procedure logs a message to the destination set by a prior 64 * call to psLogSetDestination(), if myLevel is less than the level 65 * specified by a prior call to psLogSetLevel(). The message is specified 66 * with a printf-stype string an arguments. 67 * 68 */ 69 void psLogMsg( 70 const char *name, ///< name of the log source 71 int myLevel, ///< severity level of this log message 72 const char *fmt, ///< printf-style format command 73 ... 74 ); 59 75 60 /// This procedure is functionally equivalent to psLogMsg(), except that 61 /// it takes a va_list as the message parameter, not a printf-style string. 62 void psLogMsgV(const char *name, ///< name of the log source 63 int myLevel, ///< severity level of this log message 64 const char *fmt, ///< printf-style format command 65 va_list ap ///< varargs argument list 66 ); 76 /** This procedure is functionally equivalent to psLogMsg(), except that 77 * it takes a va_list as the message parameter, not a printf-style string. 78 * 79 */ 80 void psLogMsgV( 81 const char *name, ///< name of the log source 82 int myLevel, ///< severity level of this log message 83 const char *fmt, ///< printf-style format command 84 va_list ap ///< varargs argument list 85 ); 67 86 68 87 ///< Status codes for log messages 69 88 enum { 70 PS_LOG_ABORT = 0, 71 PS_LOG_ERROR, 72 PS_LOG_WARN, 73 PS_LOG_INFO 89 PS_LOG_ABORT = 0, ///< log message is a critical error, perform an abort after printing 90 PS_LOG_ERROR, ///< log message is an error, but don't abort 91 PS_LOG_WARN, ///< log message is a warning 92 PS_LOG_INFO ///< log message is informational only 74 93 }; 75 94 76 95 ///< Destinations for log messages 77 96 enum { 78 PS_LOG_NONE, 79 PS_LOG_TO_STDERR, 80 PS_LOG_TO_STDOUT 97 PS_LOG_NONE, ///< turn off logging 98 PS_LOG_TO_STDERR, ///< log to system's stderr 99 PS_LOG_TO_STDOUT ///< log to system's stdout 81 100 }; 82 101
Note:
See TracChangeset
for help on using the changeset viewer.
