mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-21 22:03:02 +01:00
Add timestamps to logger and enable widechar for bazel build
This commit is contained in:
parent
631b1d8b08
commit
529d905bd0
@ -21,6 +21,7 @@ cc_binary(
|
||||
"-std=gnu99",
|
||||
"-DAUDIO",
|
||||
"-DGAMES",
|
||||
"-DHAVE_WIDECHAR",
|
||||
"-DPACKAGE_DATADIR='\"data\"'",
|
||||
"-DPYTHON",
|
||||
"-DQRCODE",
|
||||
|
@ -267,7 +267,12 @@ void cb_toxcore_logger(Tox *m, TOX_LOG_LEVEL level, const char *file, uint32_t l
|
||||
fp = stderr;
|
||||
}
|
||||
|
||||
fprintf(fp, "[%c] %s:%u(%s) - %s\n", tox_log_level_show(level)[0], file, line, func, message);
|
||||
const time_t t = time(NULL);
|
||||
struct tm *tmp = gmtime(&t);
|
||||
char timestamp[200];
|
||||
strftime(timestamp, sizeof(timestamp), "%F %T", tmp);
|
||||
|
||||
fprintf(fp, "[%c] %s %s:%u(%s) - %s\n", tox_log_level_show(level)[0], timestamp, file, line, func, message);
|
||||
fflush(fp);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user