From 718c8d7ac88d609b1798e01c9e6846eafb0326a9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 20 Sep 2023 12:38:26 -0700 Subject: [PATCH] main: disable stderr logging by default for lib --- src/main.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.zig b/src/main.zig index 37e35e490..bd0a25bd6 100644 --- a/src/main.zig +++ b/src/main.zig @@ -233,6 +233,11 @@ pub const GlobalState = struct { // output. if (self.action != null) self.logging = .{ .disabled = {} }; + // For lib mode we always disable stderr logging by default. + if (comptime build_config.app_runtime == .none) { + self.logging = .{ .disabled = {} }; + } + // I don't love the env var name but I don't have it in my heart // to parse CLI args 3 times (once for actions, once for config, // maybe once for logging) so for now this is an easy way to do