log: no CamelCase
Renamed the variable "logLevel" to "log_threshold".
This commit is contained in:
parent
08aaf57ff0
commit
a05fa5cdbb
14
src/log.c
14
src/log.c
@ -35,7 +35,9 @@
|
|||||||
|
|
||||||
#define LOG_DATE_BUF_SIZE 16
|
#define LOG_DATE_BUF_SIZE 16
|
||||||
#define LOG_DATE_LEN (LOG_DATE_BUF_SIZE - 1)
|
#define LOG_DATE_LEN (LOG_DATE_BUF_SIZE - 1)
|
||||||
static unsigned int logLevel = LOG_LEVEL_LOW;
|
|
||||||
|
static unsigned int log_threshold = LOG_LEVEL_LOW;
|
||||||
|
|
||||||
static int stdout_mode = 1;
|
static int stdout_mode = 1;
|
||||||
static int out_fd = -1;
|
static int out_fd = -1;
|
||||||
static int err_fd = -1;
|
static int err_fd = -1;
|
||||||
@ -75,17 +77,17 @@ void initLog(const int verbose)
|
|||||||
setvbuf(stdout, (char *)NULL, _IONBF, 0);
|
setvbuf(stdout, (char *)NULL, _IONBF, 0);
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
logLevel = LOG_LEVEL_DEBUG;
|
log_threshold = LOG_LEVEL_DEBUG;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(param = getConfigParam(CONF_LOG_LEVEL)))
|
if (!(param = getConfigParam(CONF_LOG_LEVEL)))
|
||||||
return;
|
return;
|
||||||
if (0 == strcmp(param->value, "default")) {
|
if (0 == strcmp(param->value, "default")) {
|
||||||
logLevel = LOG_LEVEL_LOW;
|
log_threshold = LOG_LEVEL_LOW;
|
||||||
} else if (0 == strcmp(param->value, "secure")) {
|
} else if (0 == strcmp(param->value, "secure")) {
|
||||||
logLevel = LOG_LEVEL_SECURE;
|
log_threshold = LOG_LEVEL_SECURE;
|
||||||
} else if (0 == strcmp(param->value, "verbose")) {
|
} else if (0 == strcmp(param->value, "verbose")) {
|
||||||
logLevel = LOG_LEVEL_DEBUG;
|
log_threshold = LOG_LEVEL_DEBUG;
|
||||||
} else {
|
} else {
|
||||||
FATAL("unknown log level \"%s\" at line %i\n",
|
FATAL("unknown log level \"%s\" at line %i\n",
|
||||||
param->value, param->line);
|
param->value, param->line);
|
||||||
@ -130,7 +132,7 @@ void setup_log_output(const int use_stdout)
|
|||||||
#define log_func(func,level,fp) \
|
#define log_func(func,level,fp) \
|
||||||
mpd_printf void func(const char *fmt, ...) \
|
mpd_printf void func(const char *fmt, ...) \
|
||||||
{ \
|
{ \
|
||||||
if ((int)logLevel >= level) { \
|
if ((int)log_threshold >= level) { \
|
||||||
va_list args; \
|
va_list args; \
|
||||||
va_start(args, fmt); \
|
va_start(args, fmt); \
|
||||||
do_log(fp, fmt, args); \
|
do_log(fp, fmt, args); \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user