[object Object]

← back to Desktop Dotbar

Gate dbg() debug.log writes behind DOTBAR_DEBUG=1 to prevent unbounded log growth

ca97694e853ad06ed2c0216c7cce34b8b2117336 · 2026-09-15 18:16:40 -0700 · Steve

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pnon7dut9MfPekhhm9YY4Q

Files touched

Diff

commit ca97694e853ad06ed2c0216c7cce34b8b2117336
Author: Steve <steve@designerwallcoverings.com>
Date:   Tue Sep 15 18:16:40 2026 -0700

    Gate dbg() debug.log writes behind DOTBAR_DEBUG=1 to prevent unbounded log growth
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01Pnon7dut9MfPekhhm9YY4Q
---
 electron-main.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/electron-main.js b/electron-main.js
index 0cd6b6d..317fff5 100644
--- a/electron-main.js
+++ b/electron-main.js
@@ -59,7 +59,7 @@ async function createWindow() {
   // Re-assert top without the off→on toggle (which caused a visible drop-flicker).
   // setAlwaysOnTop(true, ...) re-elevates on its own, including after setBounds.
   const raise = () => { try { win.setAlwaysOnTop(true, 'screen-saver'); win.moveTop(); } catch {} };
-  const dbg = (tag) => { try { fs.appendFileSync(path.join(DIR, 'debug.log'),
+  const dbg = (tag) => { if (process.env.DOTBAR_DEBUG !== '1') return; try { fs.appendFileSync(path.join(DIR, 'debug.log'),
     JSON.stringify({ tag, t: new Date().toISOString(), bounds: win.getBounds(), visible: win.isVisible(), onTop: win.isAlwaysOnTop() }) + '\n'); } catch {} };
   win.webContents.on('did-finish-load', () => { raise(); dbg('did-finish-load'); });
   win.webContents.on('did-fail-load', (_e, code, desc) => dbg('FAIL:' + code + ':' + desc));

← 98783dc stop tracking transient .port  ·  back to Desktop Dotbar  ·  debounce dropdown auto-close (2 ticks); login autostart via ead5ad7 →