diff --git a/src/bundler.zig b/src/bundler.zig index 0de0932d64..19102fd98c 100644 --- a/src/bundler.zig +++ b/src/bundler.zig @@ -3096,7 +3096,7 @@ pub const Bundler = struct { ); } - if (FeatureFlags.tracing) { + if (FeatureFlags.tracing and bundler.options.log.level == .info) { Output.prettyErrorln( "\n---Tracing---\nResolve time: {d}\nParsing time: {d}\n---Tracing--\n\n", .{ diff --git a/src/global.zig b/src/global.zig index 26c22caf6b..6ca2e0813e 100644 --- a/src/global.zig +++ b/src/global.zig @@ -298,9 +298,10 @@ pub const Output = struct { return print(fmt, args); } - pub const debug = if (Environment.isDebug) _debug else _noop; - - fn _noop(comptime _: string, _: anytype) void {} + pub inline fn debug(comptime fmt: string, args: anytype) void { + if (comptime Environment.isRelease) return; + return prettyErrorln("\nDEBUG: " ++ fmt, args); + } pub fn _debug(comptime fmt: string, args: anytype) void { std.debug.assert(source_set);