mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-25 12:53:03 +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",
|
"-std=gnu99",
|
||||||
"-DAUDIO",
|
"-DAUDIO",
|
||||||
"-DGAMES",
|
"-DGAMES",
|
||||||
|
"-DHAVE_WIDECHAR",
|
||||||
"-DPACKAGE_DATADIR='\"data\"'",
|
"-DPACKAGE_DATADIR='\"data\"'",
|
||||||
"-DPYTHON",
|
"-DPYTHON",
|
||||||
"-DQRCODE",
|
"-DQRCODE",
|
||||||
|
@ -267,7 +267,12 @@ void cb_toxcore_logger(Tox *m, TOX_LOG_LEVEL level, const char *file, uint32_t l
|
|||||||
fp = stderr;
|
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);
|
fflush(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user