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 */
|
||||
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 */
|
||||
|
||||
|
@ -159,9 +156,13 @@ void LOG_Message(LOG_Severity severity,
|
|||
fprintf(file_log, "%s ", buf);
|
||||
}
|
||||
#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],
|
||||
debug_prefix, filename, line_number, function_name);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue