Improve logging output

This commit is contained in:
Piotr Krygier committed 2023-09-26 14:15:21 +02:00
1 parent 7ca73f3c60
commit 3a58bd8756
3 files changed
+6 -5

No files matched your search

+2 -2
View File
@@ -2,7 +2,7 @@
#include "stdarg.h"
const char* log_levels[] = {
"LOGLEVEL_TRACE", "LOGLEVEL_DEBUG", "LOGLEVEL_INFO", "LOGLEVEL_WARNING", "LOGLEVEL_ERROR", "LOGLEVEL_FATAL"
"[TRACE]", "[DEBUG]", "[INFO]", "WARNING", "[ERROR]", "[FATAL]"
};
void _log_log(unsigned int level, const char* file, int line, const char* fmt, ...)
@@ -11,7 +11,7 @@ void _log_log(unsigned int level, const char* file, int line, const char* fmt, .
va_list list;
va_start(list, fmt);
fprintf(stdout, "%s %s:%d ", log_levels[level], file, line);
fprintf(stdout, "%s %s:%d: ", log_levels[level], file, line);
vfprintf(stdout, fmt, list);
fprintf(stdout, "\n");
fflush(stdout);