diff options
Diffstat (limited to 'src/dump.zig')
| -rw-r--r-- | src/dump.zig | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/dump.zig b/src/dump.zig index 06b9cec6..51221197 100644 --- a/src/dump.zig +++ b/src/dump.zig @@ -1,6 +1,11 @@ const std = @import("std"); const builtin = @import("builtin"); +// scoped, not bare std.log: main.zig's logFn drops the unscoped .default scope +// wholesale (ghostty and uucode log there too), and a corrupt dump's parse +// diagnostic is the only thing that says WHICH field went bad. +const log = std.log.scoped(.dump); + /// Where the next dump goes. $PARDES_DUMP wins verbatim (the snapshot harness /// pins it for deterministic goldens); else $XDG_DATA_HOME|~/.local/share /// /pardes/pardes-<utc>.zon — timestamped so dumps never overwrite each other. @@ -148,7 +153,7 @@ pub fn readZon(gpa: std.mem.Allocator, bytes: []const u8, label: []const u8) !St pub fn readZonZ(gpa: std.mem.Allocator, source: [:0]const u8, label: []const u8) !State { if (builtin.os.tag == .emscripten) { const state = std.zon.parse.fromSliceAlloc(State, gpa, source, null, .{}) catch |err| { - std.log.err("parse dump {s}: {s}", .{ label, @errorName(err) }); + log.err("parse dump {s}: {s}", .{ label, @errorName(err) }); return err; }; errdefer std.zon.parse.free(gpa, state); @@ -159,7 +164,7 @@ pub fn readZonZ(gpa: std.mem.Allocator, source: [:0]const u8, label: []const u8) var diag: std.zon.parse.Diagnostics = .{}; defer diag.deinit(gpa); const state = std.zon.parse.fromSliceAlloc(State, gpa, source, &diag, .{}) catch |err| { - std.log.err("parse dump {s}: {f}", .{ label, diag }); + log.err("parse dump {s}: {f}", .{ label, diag }); return err; }; errdefer std.zon.parse.free(gpa, state); |
