authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-11-10 12:55:39+00:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-11-10 12:55:39+00:00
log6d280dc1b0779209b4790da9e939d8254d11348a
treeef868d9f817500791c48489f5c1ff883f5e81922
parentcde865e06afa772983a3833920369bed5d995f8b
signaturelock-open Commit is signed but in an unrecognized format.

compiler: update logFn to use color

To match the new default implementation. In fact, I implemented this by simply dispatching *to* the default implementation after the debug log guard; no need to complicate things!

1 files changed, 2 insertions(+), 5 deletions(-)

src/main.zig+2-5
......@@ -155,11 +155,8 @@ pub fn log(
155155 } else return;
156156 }
157157
158 const prefix1 = comptime level.asText();
159 const prefix2 = if (scope == .default) ": " else "(" ++ @tagName(scope) ++ "): ";
160
161 // Print the message to stderr, silently ignoring any errors
162 std.debug.print(prefix1 ++ prefix2 ++ format ++ "\n", args);
158 // Otherwise, use the default implementation.
159 std.log.defaultLog(level, scope, format, args);
163160}
164161
165162var debug_allocator: std.heap.DebugAllocator(.{