Fix config handling

This commit is contained in:
Tobias Reisinger 2020-11-12 21:58:01 +01:00
parent fad3d80f39
commit fca35ade9e
18 changed files with 125 additions and 139 deletions

View file

@ -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);