chore(stacks): gate informational console.log behind developer_mode (#1194)

Rebased onto current main (post H-1 / H-2 / L-3 / M-2 / M-6 merges).
Same intent as the original M-5 commit:

  - Local dlog() helper in routes/stacks.ts wrapping console.log
    behind isDebugEnabled().
  - All informational console.log in stacks.ts replaced with dlog().
  - The 3 Exec session-lifecycle console.log in DockerController.ts
    wrapped with inline if (isDebugEnabled()) gates.

console.warn and console.error remain unconditional everywhere.

Resolves M-5 from the stack-management audit.
This commit is contained in:
Anso
2026-05-24 15:57:42 -04:00
committed by GitHub
parent 429f780f40
commit 60247d9c2e
2 changed files with 28 additions and 19 deletions
+3 -3
View File
@@ -1438,7 +1438,7 @@ class DockerController {
}
if (isDebugEnabled()) console.debug('[Exec:diag] Creating exec', { containerId, shell: shellType });
console.log('[Exec] Shell session started', { containerId, shell: shellType });
if (isDebugEnabled()) console.log('[Exec] Shell session started', { containerId, shell: shellType });
// --- Downstream: container output → client ---
stream.on('data', (chunk: Buffer) => {
@@ -1452,7 +1452,7 @@ class DockerController {
});
stream.on('end', () => {
console.log('[Exec] Shell session ended', { containerId, reason: 'stream-end' });
if (isDebugEnabled()) console.log('[Exec] Shell session ended', { containerId, reason: 'stream-end' });
if (ws.readyState === WebSocket.OPEN) {
ws.close();
}
@@ -1492,7 +1492,7 @@ class DockerController {
// --- Cleanup: prevent zombie processes ---
ws.on('close', () => {
console.log('[Exec] Shell session ended', { containerId, reason: 'ws-close' });
if (isDebugEnabled()) console.log('[Exec] Shell session ended', { containerId, reason: 'ws-close' });
try {
stream.destroy();
} catch (e) {