diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2009-09-04 15:24:05 +0200 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2009-09-04 15:24:05 +0200 |
commit | dea39103b369f0903be326c505d36a9d489a0c1e (patch) | |
tree | 97a114b3fe7667c07678abdf528530efae8bfea8 /common/eurephia_log.h | |
parent | 856ecfcec0956d3269f2b119836ec31908d02836 (diff) | |
download | eurephia-dea39103b369f0903be326c505d36a9d489a0c1e.tar.gz eurephia-dea39103b369f0903be326c505d36a9d489a0c1e.tar.xz eurephia-dea39103b369f0903be326c505d36a9d489a0c1e.zip |
More comments in common/
Diffstat (limited to 'common/eurephia_log.h')
-rw-r--r-- | common/eurephia_log.h | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/common/eurephia_log.h b/common/eurephia_log.h index 647c557..97e58d2 100644 --- a/common/eurephia_log.h +++ b/common/eurephia_log.h @@ -19,22 +19,36 @@ * */ +/** + * @file eurephia_log.h + * @author David Sommerseth <dazo@users.sourceforge.net> + * @date 2008-08-06 + * + * @brief Function for unified logging + * + */ + #ifndef EUREPHIA_LOG_H_ #define EUREPHIA_LOG_H_ #include <eurephia_context.h> -#define LOG_INFO 1 -#define LOG_DEBUG 2 -#define LOG_WARNING 3 -#define LOG_ERROR 4 -#define LOG_CRITICAL 5 -#define LOG_FATAL 6 -#define LOG_PANIC 7 +#define LOG_INFO 1 /**< Informational messages. Log level should be < 5 */ +#define LOG_DEBUG 2 /**< Messages intended when debugging. Only for log level > 10 */ +#define LOG_WARNING 3 /**< Input data or processing revealed unexpected data. Log level never > 2*/ +#define LOG_ERROR 4 /**< API errors but not sever, program can continue to run */ +#define LOG_CRITICAL 5 /**< Operation failed and might have been aborted. Log level always 0 */ +#define LOG_FATAL 6 /**< Operation failed and cannot continue. Log level always < 2 */ +#define LOG_PANIC 7 /**< Action failed an program could not continue to run. Log level always 0 */ #ifdef ENABLE_DEBUG #warning ###### DEBUG LOGGING IS ENABLED - THIS COULD BE A SECURITY ISSUE ###### -#define DEBUG(ctx, lvl, rest...) eurephia_log(ctx, LOG_DEBUG, lvl, ## rest); +/** + * Wrapper function for DEBUG statements. This is used to avoid adding debug code into the compiled + * binary if debug logging is not enabled at compile time. This will always use the LOG_DEBUG target + * when calling eurephia_log(). + */ +#define DEBUG(ctx, log_level, log_string...) eurephia_log(ctx, LOG_DEBUG, log_level, ## log_string); #else #define DEBUG(ctx, lvl, rest...) {}; #endif |