From eadca53e7b59ca97e2147c2c8254e7afee4244c3 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Mon, 14 Feb 2022 04:27:53 -0800 Subject: [PATCH] cleanup --- src/bundler.zig | 2 +- src/global.zig | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) 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);