Skip to content

Commit

Permalink
fix: remove filepath from log
Browse files Browse the repository at this point in the history
  • Loading branch information
neferin12 committed Nov 8, 2023
1 parent 3cf9367 commit 93b10bc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions c/src/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@ static void stdout_callback(log_Event *ev) {
buf[strftime(buf, sizeof(buf), "%H:%M:%S", ev->time)] = '\0';
#ifdef LOG_USE_COLOR
fprintf(
ev->udata, "%s %s%-5s\x1b[0m \x1b[90m%s:%d:\x1b[0m ",
buf, level_colors[ev->level], level_strings[ev->level],
ev->file, ev->line);
ev->udata, "%s %s%-5s\x1b[0m \x1b[90m:\x1b[0m ",
buf, level_colors[ev->level], level_strings[ev->level]);
#else
fprintf(
ev->udata, "%s %-5s %s:%d: ",
buf, level_strings[ev->level], ev->file, ev->line);
ev->udata, "%s %-5s: ",
buf, level_strings[ev->level]);
#endif
vfprintf(ev->udata, ev->fmt, ev->ap);
fprintf(ev->udata, "\n");
Expand All @@ -73,8 +72,8 @@ static void file_callback(log_Event *ev) {
char buf[64];
buf[strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", ev->time)] = '\0';
fprintf(
ev->udata, "%s %-5s %s:%d: ",
buf, level_strings[ev->level], ev->file, ev->line);
ev->udata, "%s %-5s: ",
buf, level_strings[ev->level]);
vfprintf(ev->udata, ev->fmt, ev->ap);
fprintf(ev->udata, "\n");
fflush(ev->udata);
Expand Down

0 comments on commit 93b10bc

Please sign in to comment.