From 8bf03ff64ab8dc4329ff8441da3d192b13da06c9 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Thu, 29 Jan 2026 13:18:13 -0600 Subject: [PATCH] core: guard app message logging to ensure it's optimized away in release builds --- src/App.zig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/App.zig b/src/App.zig index cd8b67164..2ead3b9ad 100644 --- a/src/App.zig +++ b/src/App.zig @@ -237,10 +237,12 @@ pub fn needsConfirmQuit(self: *const App) bool { /// Drain the mailbox. fn drainMailbox(self: *App, rt_app: *apprt.App) !void { while (self.mailbox.pop()) |message| { - switch (message) { - // these tend to be way too verbose for normal debugging - .redraw_surface, .redraw_inspector => {}, - else => log.debug("mailbox message={t}", .{message}), + if (std.log.logEnabled(.debug, .app)) { + switch (message) { + // these tend to be way too verbose for normal debugging + .redraw_surface, .redraw_inspector => {}, + else => log.debug("mailbox message={t}", .{message}), + } } switch (message) { .open_config => try self.performAction(rt_app, .open_config),