1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-12-12 09:26:34 +01:00

Fix style issues

This commit is contained in:
jfreegman
2022-06-27 19:42:38 -04:00
parent 146b00b8ca
commit 058057c64d
3 changed files with 14 additions and 3 deletions

View File

@@ -269,13 +269,20 @@ void cb_toxcore_logger(Tox *m, TOX_LOG_LEVEL level, const char *file, uint32_t l
}
struct timeval tv;
gettimeofday(&tv, NULL);
struct tm tmp;
gmtime_r(&tv.tv_sec, &tmp);
char timestamp[200];
strftime(timestamp, sizeof(timestamp), "%F %T", &tmp);
fprintf(fp, "%c %s.%06ld %s:%u(%s) - %s\n", tox_log_level_show(level)[0], timestamp, tv.tv_usec, file, line, func, message);
fprintf(fp, "%c %s.%06ld %s:%u(%s) - %s\n", tox_log_level_show(level)[0], timestamp, tv.tv_usec, file, line, func,
message);
fflush(fp);
}