ReviewOS

also looking at this

craft-native/craft

fix(log): keep the terminal's colour, and let logging be turned off

#81
Merged glennmichael123 wants to merge fix/log-colour-and-off into main
4 files +126 -16
packages/zig/src/bridge_log.zigmodified+4-0
Changes to packages/zig/src/bridge_log.zig
@@ -91,6 +91,10 @@ pub const LogBridge = struct {
9191 .Warning => host_log.log(.Warning, "[page] {s}", .{message}),
9292 .Error => host_log.log(.Error, "[page] {s}", .{message}),
9393 .Fatal => host_log.log(.Fatal, "[page] {s}", .{message}),
94 // `levelFor` never returns this — a page cannot ask to be silenced,
95 // only the host can — but the switch stays exhaustive so adding a
96 // level is a compile error rather than a dropped record.
97 .Off => {},
9498 }
9599
96100 bridge_error.sendResultToJS(self.allocator, "log", "{\"ok\":true}");