diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-10-11 18:39:56 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-10-11 18:39:56 +0400 |
commit | dbee2f63ee747b5d4247038f27566bc5aebfe3b7 (patch) | |
tree | c2d60701691ab106e593be24a6974ab7dc0e6fa1 /src/logger.h | |
parent | b0ce5fefb9e694083846af1e45b09f4baa4b0446 (diff) | |
download | rspamd-dbee2f63ee747b5d4247038f27566bc5aebfe3b7.tar.gz rspamd-dbee2f63ee747b5d4247038f27566bc5aebfe3b7.zip |
Fixes bugs found with clang-static analyser.
Strictly follow c99 standart.
Turn on pedantic c99 checks.
Diffstat (limited to 'src/logger.h')
-rw-r--r-- | src/logger.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/logger.h b/src/logger.h index 84c8a41ff..f2adf65c6 100644 --- a/src/logger.h +++ b/src/logger.h @@ -4,6 +4,7 @@ #include "config.h" #include "cfg_file.h" #include "radix.h" +#include "util.h" /** * Process type: main or worker @@ -76,18 +77,18 @@ void rspamd_log_nodebug (); /* Logging in postfix style */ #if (defined(RSPAMD_MAIN) || defined(RSPAMD_LIB) || defined(RSPAMD_TEST)) -#define msg_err(args...) rspamd_common_log_function(G_LOG_LEVEL_CRITICAL, __FUNCTION__, ##args) -#define msg_warn(args...) rspamd_common_log_function(G_LOG_LEVEL_WARNING, __FUNCTION__, ##args) -#define msg_info(args...) rspamd_common_log_function(G_LOG_LEVEL_INFO, __FUNCTION__, ##args) -#define msg_debug(args...) rspamd_conditional_debug(-1, __FUNCTION__, ##args) -#define debug_task(args...) rspamd_conditional_debug(task->from_addr.s_addr, __FUNCTION__, ##args) -#define debug_ip(ip, args...) rspamd_conditional_debug((ip), __FUNCTION__, ##args) +#define msg_err(...) rspamd_common_log_function(G_LOG_LEVEL_CRITICAL, __FUNCTION__, __VA_ARGS__) +#define msg_warn(...) rspamd_common_log_function(G_LOG_LEVEL_WARNING, __FUNCTION__, __VA_ARGS__) +#define msg_info(...) rspamd_common_log_function(G_LOG_LEVEL_INFO, __FUNCTION__, __VA_ARGS__) +#define msg_debug(...) rspamd_conditional_debug(-1, __FUNCTION__, __VA_ARGS__) +#define debug_task(...) rspamd_conditional_debug(task->from_addr.s_addr, __FUNCTION__, __VA_ARGS__) + #else -#define msg_err(args...) fprintf(stderr, ##args) -#define msg_warn(args...) fprintf(stderr, ##args) -#define msg_info(args...) fprintf(stderr, ##args) -#define msg_debug(args...) fprintf(stderr, ##args) -#define debug_task(args...) fprintf(stderr, ##args) +#define msg_err(...) rspamd_fprintf(stderr, __VA_ARGS__) +#define msg_warn(...) rspamd_fprintf(stderr, __VA_ARGS__) +#define msg_info(...) rspamd_fprintf(stderr, __VA_ARGS__) +#define msg_debug(...) rspamd_fprintf(stderr, __VA_ARGS__) +#define debug_task(...) rspamd_fprintf(stderr, __VA_ARGS__) #endif #endif |