mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-01 01:14:22 +00:00
VS2010 build: Converted applog() macro to function.
This commit is contained in:
parent
21c007e842
commit
feac311305
13
logging.c
13
logging.c
@ -49,6 +49,19 @@ static void my_log_curses(int prio, const char *datetime, const char *str, bool
|
||||
|
||||
/* high-level logging function, based on global opt_log_level */
|
||||
|
||||
void applog(int prio, const char* fmt, ...) {
|
||||
va_list args;
|
||||
|
||||
if (opt_debug || prio != LOG_DEBUG) {
|
||||
if (use_syslog || opt_log_output || prio <= opt_log_level) {
|
||||
char tmp42[LOGBUFSIZ];
|
||||
va_start(args, fmt);
|
||||
vsnprintf(tmp42, sizeof(tmp42), fmt, args);
|
||||
va_end(args);
|
||||
_applog(prio, tmp42, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* log function
|
||||
*/
|
||||
|
11
logging.h
11
logging.h
@ -30,20 +30,11 @@ extern int opt_log_show_date;
|
||||
|
||||
#define LOGBUFSIZ 256
|
||||
|
||||
void applog(int prio, const char* fmt, ...);
|
||||
extern void _applog(int prio, const char *str, bool force);
|
||||
|
||||
#define IN_FMT_FFL " in %s %s():%d"
|
||||
|
||||
#define applog(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, false); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define applogsiz(prio, _SIZ, fmt, ...) do { \
|
||||
if (opt_debug || prio != LOG_DEBUG) { \
|
||||
if (use_syslog || opt_log_output || prio <= opt_log_level) { \
|
||||
|
Loading…
x
Reference in New Issue
Block a user