mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-26 02:06:49 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user