|
|
|
@ -28,7 +28,7 @@ extern int opt_log_level;
@@ -28,7 +28,7 @@ extern int opt_log_level;
|
|
|
|
|
|
|
|
|
|
#define LOGBUFSIZ 256 |
|
|
|
|
|
|
|
|
|
extern void _applog(int prio, const char *str); |
|
|
|
|
extern void _applog(int prio, const char *str, bool force); |
|
|
|
|
|
|
|
|
|
#define IN_FMT_FFL " in %s %s():%d" |
|
|
|
|
|
|
|
|
@ -37,7 +37,7 @@ extern void _applog(int prio, const char *str);
@@ -37,7 +37,7 @@ extern void _applog(int prio, const char *str);
|
|
|
|
|
if (use_syslog || opt_log_output || prio <= opt_log_level) { \ |
|
|
|
|
char tmp42[LOGBUFSIZ]; \ |
|
|
|
|
snprintf(tmp42, sizeof(tmp42), fmt, ##__VA_ARGS__); \ |
|
|
|
|
_applog(prio, tmp42); \ |
|
|
|
|
_applog(prio, tmp42, false); \ |
|
|
|
|
} \ |
|
|
|
|
} \ |
|
|
|
|
} while (0) |
|
|
|
@ -47,7 +47,17 @@ extern void _applog(int prio, const char *str);
@@ -47,7 +47,17 @@ extern void _applog(int prio, const char *str);
|
|
|
|
|
if (use_syslog || opt_log_output || prio <= opt_log_level) { \ |
|
|
|
|
char tmp42[_SIZ]; \ |
|
|
|
|
snprintf(tmp42, sizeof(tmp42), fmt, ##__VA_ARGS__); \ |
|
|
|
|
_applog(prio, tmp42); \ |
|
|
|
|
_applog(prio, tmp42, false); \ |
|
|
|
|
} \ |
|
|
|
|
} \ |
|
|
|
|
} while (0) |
|
|
|
|
|
|
|
|
|
#define forcelog(prio, fmt, ...) do { \ |
|
|
|
|
if (opt_debug || prio != LOG_DEBUG) { \ |
|
|
|
|
if (use_syslog || opt_log_output || prio <= opt_log_level) { \ |
|
|
|
|
char tmp42[LOGBUFSIZ]; \ |
|
|
|
|
snprintf(tmp42, sizeof(tmp42), fmt, ##__VA_ARGS__); \ |
|
|
|
|
_applog(prio, tmp42, true); \ |
|
|
|
|
} \ |
|
|
|
|
} \ |
|
|
|
|
} while (0) |
|
|
|
@ -56,7 +66,7 @@ extern void _applog(int prio, const char *str);
@@ -56,7 +66,7 @@ extern void _applog(int prio, const char *str);
|
|
|
|
|
if (fmt) { \ |
|
|
|
|
char tmp42[LOGBUFSIZ]; \ |
|
|
|
|
snprintf(tmp42, sizeof(tmp42), fmt, ##__VA_ARGS__); \ |
|
|
|
|
_applog(LOG_ERR, tmp42); \ |
|
|
|
|
_applog(LOG_ERR, tmp42, true); \ |
|
|
|
|
} \ |
|
|
|
|
_quit(status); \ |
|
|
|
|
} while (0) |
|
|
|
@ -66,7 +76,7 @@ extern void _applog(int prio, const char *str);
@@ -66,7 +76,7 @@ extern void _applog(int prio, const char *str);
|
|
|
|
|
char tmp42[LOGBUFSIZ]; \ |
|
|
|
|
snprintf(tmp42, sizeof(tmp42), fmt IN_FMT_FFL, \ |
|
|
|
|
##__VA_ARGS__, __FILE__, __func__, __LINE__); \ |
|
|
|
|
_applog(LOG_ERR, tmp42); \ |
|
|
|
|
_applog(LOG_ERR, tmp42, true); \ |
|
|
|
|
} \ |
|
|
|
|
_quit(status); \ |
|
|
|
|
} while (0) |
|
|
|
@ -76,7 +86,7 @@ extern void _applog(int prio, const char *str);
@@ -76,7 +86,7 @@ extern void _applog(int prio, const char *str);
|
|
|
|
|
char tmp42[LOGBUFSIZ]; \ |
|
|
|
|
snprintf(tmp42, sizeof(tmp42), fmt IN_FMT_FFL, \ |
|
|
|
|
##__VA_ARGS__, _file, _func, _line); \ |
|
|
|
|
_applog(LOG_ERR, tmp42); \ |
|
|
|
|
_applog(LOG_ERR, tmp42, true); \ |
|
|
|
|
} \ |
|
|
|
|
_quit(status); \ |
|
|
|
|
} while (0) |
|
|
|
|