mirror of
https://github.com/ziglang/zig.git
synced 2026-02-16 14:28:57 +00:00
add std.debug.Trace.format
This makes it show up in some useful places; for example in the self-hosted compiler we already print it now with --debug-compile-errors.
This commit is contained in:
parent
85492f2b91
commit
c29746aa55
@ -2023,5 +2023,22 @@ pub fn ConfigurableTrace(comptime size: usize, comptime stack_frame_count: usize
|
||||
}) catch return;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn format(
|
||||
t: Trace,
|
||||
comptime fmt: []const u8,
|
||||
options: std.fmt.FormatOptions,
|
||||
writer: anytype,
|
||||
) !void {
|
||||
_ = fmt;
|
||||
_ = options;
|
||||
if (enabled) {
|
||||
try writer.writeAll("\n");
|
||||
t.dump();
|
||||
try writer.writeAll("\n");
|
||||
} else {
|
||||
return writer.writeAll("(value tracing disabled)");
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user