From f10afce9821a81c8dd138b84a4f1ab56116af20b Mon Sep 17 00:00:00 2001 From: steven-na Date: Fri, 14 Aug 2026 16:31:44 -0700 Subject: Add log messages, can be disabled. Made return values more consistent --- src/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/log.c') diff --git a/src/log.c b/src/log.c index 03b81e9..670fbb5 100644 --- a/src/log.c +++ b/src/log.c @@ -56,7 +56,7 @@ static inline void write_to_file(LogLevelE lvl, const char *src_file, u64 src_li char time_str[64]; time_str[strftime(time_str, sizeof(time_str), "%Y-%m-%d %H:%M:%S", time)] = '\0'; - fprintf(L.log_file, "%s %-5s%s:%lu ", time_str, level_strings[lvl], src_file, src_line); + fprintf(L.log_file, "%s [%-5s] %s:%lu ", time_str, level_strings[lvl], src_file, src_line); vfprintf(L.log_file, fmt, va); fprintf(L.log_file, "\n"); } @@ -81,7 +81,7 @@ void log_log(LogLevelE lvl, const char *src_file, u64 src_line, const char *fmt, time_str[strftime(time_str, sizeof(time_str), "%H:%M:%S", time)] = '\0'; #ifndef LOG_NO_COLOR - fprintf(L.log_default, "%s %s%-5s\x1b[0m\x1b[90m%s:%lu:\x1b[0m ", + fprintf(L.log_default, "%s %s[%-5s] \x1b[0m\x1b[90m%s:%lu:\x1b[0m ", time_str, level_colors[lvl], level_strings[lvl], src_file, src_line); #else fprintf(L.log_default, "%s %-5s %s:%lu: ", -- cgit v1.2.3