X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcfg%2Flog.h;h=05cd5f15588c0e6ff91568b17e6ca94fbf98453e;hb=7a613efa9f80222fa9642bfb6a249972c7ae6c6e;hp=cd3e1f3df676a99643f0ab09c20d92a7b243883f;hpb=5ed881e1e315a5bd8091f598366dee76e4df2eb9;p=bertos.git diff --git a/bertos/cfg/log.h b/bertos/cfg/log.h index cd3e1f3d..05cd5f15 100644 --- a/bertos/cfg/log.h +++ b/bertos/cfg/log.h @@ -30,7 +30,9 @@ * * --> * - * \addtogroup logging + * \defgroup logging Logging facilities + * \ingroup core + * \{ * \brief Logging system module. * * This module implement a simple interface to use the multi level logging system. @@ -102,11 +104,6 @@ #include -/** - * \defgroup logging Logging facilities - * \{ - */ - // Use a default setting if nobody defined a log level #ifndef LOG_LEVEL #define LOG_LEVEL LOG_LVL_ERR @@ -148,12 +145,33 @@ #define LOG_FMT_TERSE 0 /** \} */ -#if LOG_FORMAT == LOG_FMT_VERBOSE - #define LOG_PRINT(str_level, str,...) kprintf("%s():%d:%s: " str, __func__, __LINE__, str_level, ## __VA_ARGS__) -#elif LOG_FORMAT == LOG_FMT_TERSE - #define LOG_PRINT(str_level, str,...) kprintf("%s: " str, str_level, ## __VA_ARGS__) +#include "cfg/cfg_syslog.h" + +/* For backward compatibility */ +#ifndef CONFIG_SYSLOG_NET + #define CONFIG_SYSLOG_NET 0 +#endif + +#if (CONFIG_SYSLOG_NET && !ARCH_NIGHTTEST) + #include + + #if LOG_FORMAT == LOG_FMT_VERBOSE + #define LOG_PRINT(str_level, str,...) syslog_printf("<182>%d-%s():%d:%s: " str, syslog_count(), __func__, __LINE__, str_level, ## __VA_ARGS__) + #elif LOG_FORMAT == LOG_FMT_TERSE + #define LOG_PRINT(str_level, str,...) syslog_printf("<182>%d-%s: " str, syslog_count(), str_level, ## __VA_ARGS__) + #else + #error No LOG_FORMAT defined + #endif + #else - #error No LOG_FORMAT defined + #if LOG_FORMAT == LOG_FMT_VERBOSE + #define LOG_PRINT(str_level, str,...) kprintf("%s():%d:%s: " str, __func__, __LINE__, str_level, ## __VA_ARGS__) + #elif LOG_FORMAT == LOG_FMT_TERSE + #define LOG_PRINT(str_level, str,...) kprintf("%s: " str, str_level, ## __VA_ARGS__) + #else + #error No LOG_FORMAT defined + #endif + #endif #if LOG_LEVEL >= LOG_LVL_ERR