From 6efcfcded913ab880189e0c41931414bca8e1ddf Mon Sep 17 00:00:00 2001 From: Pascal Zittlau Date: Mon, 27 Oct 2025 14:14:36 +0100 Subject: [PATCH] disable in test --- src/root.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/root.zig b/src/root.zig index 82ad36d..8c094d4 100644 --- a/src/root.zig +++ b/src/root.zig @@ -1,5 +1,6 @@ const std = @import("std"); const root = @import("root"); +const builtin = @import("builtin"); pub const options: Options = if (@hasDecl(root, "faller_options")) root.faller_options else .{}; @@ -24,6 +25,7 @@ pub const Options = struct { /// tags is present it **isn't** logged. May overwrite `tags_enabled`. tags_disabled: []const @Type(.enum_literal) = &.{}, buffer_size: u64 = 64, + disabled_in_test: bool = true, }; pub fn Logger(comptime base_tags: []const @Type(.enum_literal)) type { @@ -48,6 +50,8 @@ pub fn Logger(comptime base_tags: []const @Type(.enum_literal)) type { comptime format: []const u8, args: anytype, ) void { + if (options.disabled_in_test) return; + const all_tags = comptime base_tags ++ tags; if (!options.enabled(all_tags)) return;