Fix config handling
This commit is contained in:
parent
fad3d80f39
commit
fca35ade9e
18 changed files with 125 additions and 139 deletions
src
|
@ -17,7 +17,7 @@ const char *COLOR_EMERG = COLOR_MAGENTA;
|
|||
void
|
||||
logger_log(int level, const char *filename, int line, const char *func, const char *msg, ...)
|
||||
{
|
||||
if(global_config.log_level < level || level == LOG_NONE )
|
||||
if(global_config->log_level < level || level == LOG_NONE )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -76,8 +76,8 @@ logger_log(int level, const char *filename, int line, const char *func, const ch
|
|||
char *buffer_timed = malloc(sizeof(char) * (strlen(timestamp_str) + strlen(buffer) + 2));
|
||||
sprintf(buffer_timed, "%s %s", timestamp_str, buffer);
|
||||
va_start(args, msg);
|
||||
vfprintf(global_config.log_file, buffer_timed, args);
|
||||
fflush(global_config.log_file);
|
||||
vfprintf(global_config->log_file, buffer_timed, args);
|
||||
fflush(global_config->log_file);
|
||||
va_end(args);
|
||||
|
||||
free(buffer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue