X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcfg%2Flog.h;h=a09de318d26f94483b70d597126bdb826d2e4d5e;hb=3a9f71a83372f6e3d66ad64fd7ad5524940eec70;hp=f490669265d4c6d5b3344ebc1b51b431e10dcc74;hpb=f481adc9d8e495b3a306c996a8e064ccdd70ac43;p=bertos.git diff --git a/bertos/cfg/log.h b/bertos/cfg/log.h index f4906692..a09de318 100644 --- a/bertos/cfg/log.h +++ b/bertos/cfg/log.h @@ -83,9 +83,9 @@ * LOG_LEVEL and LOG_VERBOSE macros must be defined before to include log module, * otherwise the log module use a default settings. * - * \version $Id$ * \author Daniele Basile * + * $WIZ$ */ #ifndef CFG_LOG_H @@ -111,29 +111,27 @@ * also which print function are linked. * If you choose a low level of log you link all log function (error, warning and info), * but if choose a hight level you link only that have the priority egual or hight. - * The priority level go from error (most hight) to info (most low) (see cfg/debug.h + * The priority level go from error (highest) to info (lowest) (see cfg/debug.h * for more detail). - * \{ + * + * $WIZ$ log_level = "LOG_LVL_NONE", "LOG_LVL_ERR", "LOG_LVL_WARN", "LOG_LVL_INFO" + * } */ #define LOG_LVL_NONE 0 #define LOG_LVL_ERR 1 #define LOG_LVL_WARN 2 #define LOG_LVL_INFO 3 -/* \} */ /** * \name Logging format * * There are two logging format: terse and verbose. The latter prepends * function names and line number information to each log entry. - * \{ + * + * $WIZ$ log_format = "LOG_FMT_VERBOSE", "LOG_FMT_TERSE" */ #define LOG_FMT_VERBOSE 1 #define LOG_FMT_TERSE 0 -/* \} */ - -#define LOG_SILENT LOG_FMT_TERSE /* OBSOLETE */ -#define LOG_VERBOSE LOG_FMT_VERBOSE /* OBSOLETE */ #if LOG_FORMAT == LOG_FMT_VERBOSE #define LOG_PRINT(str_level, str,...) kprintf("%s():%d:%s: " str, __func__, __LINE__, str_level, ## __VA_ARGS__) @@ -145,20 +143,27 @@ #if LOG_LEVEL >= LOG_LVL_ERR #define LOG_ERR(str,...) LOG_PRINT("ERR", str, ## __VA_ARGS__) + #define LOG_ERRB(x) x #else - #define LOG_ERR(str,...) /* Nothing */ + INLINE void LOG_ERR(UNUSED_ARG(const char *, fmt), ...) { /* nop */ } + #define LOG_ERRB(x) /* Nothing */ #endif #if LOG_LEVEL >= LOG_LVL_WARN #define LOG_WARN(str,...) LOG_PRINT("WARN", str, ## __VA_ARGS__) + #define LOG_WARNB(x) x #else - #define LOG_WARN(str,...) /* Nothing */ + INLINE void LOG_WARN(UNUSED_ARG(const char *, fmt), ...) { /* nop */ } + #define LOG_WARNB(x) /* Nothing */ #endif #if LOG_LEVEL >= LOG_LVL_INFO #define LOG_INFO(str,...) LOG_PRINT("INFO", str, ## __VA_ARGS__) + #define LOG_INFOB(x) x #else - #define LOG_INFO(str,...) /* Nothing */ + INLINE void LOG_INFO(UNUSED_ARG(const char *, fmt), ...) { /* nop */ } + #define LOG_INFOB(x) /* Nothing */ #endif + #endif /* CFG_LOG_H */