X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=common%2Fcommon.h;fp=common%2Fcommon.h;h=af393e556c7b2454037ce414bf95246dbefcff04;hb=af645f579c2652e6a095876048565d03a9434286;hp=5e6757b4099c209bb5f135b26eea89571773e5cc;hpb=d0a502789c9dbe4cb914c2a621e3b52eec43f06a;p=apps%2Fpfixtools.git diff --git a/common/common.h b/common/common.h index 5e6757b..af393e5 100644 --- a/common/common.h +++ b/common/common.h @@ -94,14 +94,14 @@ void common_init(void); : (L) == LOG_ALERT ? "alert " \ : "??? " ) -#define __log(Level, Fmt, ...) \ - if (log_level >= Level) { \ - if (log_syslog) { \ - syslog(Level, Fmt, ##__VA_ARGS__); \ - } else { \ - fprintf(stderr, "[%s] " Fmt "\n", \ - __level_name(Level), ##__VA_ARGS__); \ - } \ +#define __log(Level, Fmt, ...) \ + if (log_level >= Level) { \ + if (log_syslog) { \ + syslog(Level, "%s" Fmt, log_state, ##__VA_ARGS__); \ + } else { \ + fprintf(stderr, "[%s] %s" Fmt "\n", \ + __level_name(Level), log_state, ##__VA_ARGS__);\ + } \ } #define debug(Fmt, ...) __log(LOG_DEBUG, Fmt, ##__VA_ARGS__) @@ -118,6 +118,7 @@ void common_init(void); extern int log_level; extern bool log_syslog; +extern const char *log_state; void common_sighandler(int sig);