typedef int (*initcall_t)(void);
typedef void (*exitcall_t)(void);
-void common_register_exit(exitcall_t _exit);
+void common_register_exit(exitcall_t exitcall);
void common_init(void);
#define module_init(fn) \
: (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__)
extern int log_level;
extern bool log_syslog;
+extern const char *log_state;
void common_sighandler(int sig);