fix: timezone issue
This commit is contained in:
parent
ad7a6028b3
commit
27cec1d8cc
10 changed files with 27 additions and 28 deletions
3
logger.c
3
logger.c
|
@ -46,8 +46,7 @@ logger_log(FILE *stream, log_level_t level, const char *filename, int line, cons
|
|||
}
|
||||
|
||||
char timestamp_str[32];
|
||||
time_t rawtime;
|
||||
time(&rawtime);
|
||||
time_t rawtime = time(NULL);
|
||||
strftime(timestamp_str, 32, "%Y-%m-%d %H:%M:%S", localtime(&rawtime));
|
||||
|
||||
fprintf(stream, "%s %s:%d:%s " COLOR_NONE, timestamp_str, filename, line, func);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue