summaryrefslogtreecommitdiff
path: root/src/log.c
diff options
context:
space:
mode:
authorsteven-na <noreply.github@stvnc.dev>2026-08-14 16:31:44 -0700
committersteven-na <noreply.github@stvnc.dev>2026-08-14 16:31:44 -0700
commitf10afce9821a81c8dd138b84a4f1ab56116af20b (patch)
tree0233ed16ced2a3e36793ff48a2ff5384dcacf74f /src/log.c
parentd3e8a2361f78ef505c8cae2e30faefbfae5c88e1 (diff)
Add log messages, can be disabled. Made return values more consistent
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c4
1 files changed, 2 insertions, 2 deletions
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: ",