logging: move severity_chars to fix compiler warning
This commit is contained in:
parent
f6f1863fe2
commit
c063b9e78a
1 changed files with 5 additions and 4 deletions
|
@ -68,9 +68,6 @@ static struct LogFile logfiles[MAX_FILELOGS];
|
||||||
/* Global prefix for debug messages */
|
/* Global prefix for debug messages */
|
||||||
static char *debug_prefix;
|
static char *debug_prefix;
|
||||||
|
|
||||||
/* Log severity to character mapping (debug, info, warn, err, fatal) */
|
|
||||||
static const char severity_chars[LOGS_FATAL - LOGS_DEBUG + 1] = {'D', 'I', 'W', 'E', 'F'};
|
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
/* Init function */
|
/* Init function */
|
||||||
|
|
||||||
|
@ -159,9 +156,13 @@ void LOG_Message(LOG_Severity severity,
|
||||||
fprintf(file_log, "%s ", buf);
|
fprintf(file_log, "%s ", buf);
|
||||||
}
|
}
|
||||||
#if DEBUG > 0
|
#if DEBUG > 0
|
||||||
if (log_min_severity <= LOGS_DEBUG)
|
if (log_min_severity <= LOGS_DEBUG) {
|
||||||
|
/* Log severity to character mapping (debug, info, warn, err, fatal) */
|
||||||
|
const char severity_chars[LOGS_FATAL - LOGS_DEBUG + 1] = {'D', 'I', 'W', 'E', 'F'};
|
||||||
|
|
||||||
fprintf(file_log, "%c:%s%s:%d:(%s) ", severity_chars[severity - LOGS_DEBUG],
|
fprintf(file_log, "%c:%s%s:%d:(%s) ", severity_chars[severity - LOGS_DEBUG],
|
||||||
debug_prefix, filename, line_number, function_name);
|
debug_prefix, filename, line_number, function_name);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue