diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-12 09:43:19 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-12 09:43:19 +0200 |
| commit | 0b2af471b6d5dfc4eaf53639102c1b854bbb324b (patch) | |
| tree | aba3943b8c54d26d8552d0685d4178bc995d91c3 /src/zeroscript/log/root.zig | |
| parent | 812f547d84b5ce1a2924ae16f6257e4fd19efcc0 (diff) | |
first version of zilch
Diffstat (limited to 'src/zeroscript/log/root.zig')
| -rw-r--r-- | src/zeroscript/log/root.zig | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/zeroscript/log/root.zig b/src/zeroscript/log/root.zig deleted file mode 100644 index ba9141e..0000000 --- a/src/zeroscript/log/root.zig +++ /dev/null @@ -1,28 +0,0 @@ -const std = @import("std"); - -pub const js = @import("js.zig"); - -pub fn default( - comptime level: std.log.Level, - comptime scope: @EnumLiteral(), - comptime format: []const u8, - args: anytype, -) void { - var buffer: [1024]u8 = undefined; - var writer: std.Io.Writer = .fixed(&buffer); - - const func = switch (level) { - .err => js.err, - .warn => js.warn, - .info => js.log, - .debug => js.debug, - }; - - if (scope != .default) { - writer.print("[{s}]: ", .{@tagName(scope)}) catch unreachable; - } - writer.print(format, args) catch unreachable; - - func(writer.buffered()); -} - |