Skip to content

Commit

Permalink
minor fix of log format
Browse files Browse the repository at this point in the history
Signed-off-by: smallkirby <[email protected]>
  • Loading branch information
smallkirby committed Sep 3, 2024
1 parent a3d58ae commit 8f6439e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ymir/log.zig
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ fn log(
.warn => "[WARN ]",
.err => "[ERROR]",
};
const scope_str = if (scope == .default) ": " else "(" ++ @tagName(scope) ++ "): ";

const scope_str = if (@tagName(scope).len <= 7) b: {
break :b std.fmt.comptimePrint("{s: <7} | ", .{@tagName(scope)});
} else b: {
break :b std.fmt.comptimePrint("{s: <7}-| ", .{@tagName(scope)[0..7]});
};

std.fmt.format(
Writer{ .context = {} },
Expand Down

0 comments on commit 8f6439e

Please sign in to comment.