Skip to content

Route all liveLog/liveWarn calls to Live Debugger panel#67

Merged
MarcosBrendonDePaula merged 7 commits intomainfrom
claude/reduce-live-component-logs-VYrDQ
Feb 22, 2026
Merged

Route all liveLog/liveWarn calls to Live Debugger panel#67
MarcosBrendonDePaula merged 7 commits intomainfrom
claude/reduce-live-component-logs-VYrDQ

Conversation

@MarcosBrendonDePaula
Copy link
Copy Markdown
Collaborator

Summary

This PR decouples console logging from debug panel visibility by always forwarding liveLog() and liveWarn() calls to the Live Debugger, regardless of the LIVE_LOGGING environment variable setting. This allows developers to keep the console clean while still seeing all logging details in the debug panel when DEBUG_LIVE is enabled.

Key Changes

  • LiveLogger.ts:

    • Added emitToDebugger() function to forward log entries to the Live Debugger as LOG events
    • Modified liveLog() and liveWarn() to always emit to debugger before checking console logging config
    • Updated documentation to clarify that all liveLog/liveWarn calls go to the debug panel regardless of LIVE_LOGGING setting
    • Added import of liveDebugger from LiveDebugger module
  • FileUploadManager.ts:

    • Replaced 11 console.log() and console.warn() calls with liveLog('messages', ...) and liveWarn('messages', ...) calls
    • Properly passes componentId or null to categorize upload-related messages
  • WebSocketConnectionManager.ts:

    • Replaced 10 console.log() and console.warn() calls with liveLog('websocket', ...) and liveWarn('websocket', ...) calls
    • Categorizes connection and message queue operations appropriately
  • runtime.config.ts:

    • Changed DEBUG_LIVE default from true in development to false (opt-in only)
    • Updated documentation to reflect opt-in behavior
  • LiveCounter.ts:

    • Removed unused static logging configuration (no longer needed with new approach)
  • LiveDebugger.ts:

    • Added 'LOG' to DebugEventType union to support new log event type

Implementation Details

The new emitToDebugger() function intelligently packages log arguments:

  • Single object arguments are stored as details
  • Multiple arguments are stored as an array in details
  • All logs include category, level, and message fields

This ensures the debug panel receives structured, categorized logging data while the console output remains controlled by the LIVE_LOGGING environment variable.

https://claude.ai/code/session_01EUCPXXmAWMM4NLiYD6jVPc

…ole.log

WebSocketConnectionManager and FileUploadManager were using direct
console.log/warn calls, bypassing the existing LiveLogger system.
This caused noisy output (connection pool, state signing, ping messages)
even when LIVE_LOGGING was disabled. All informational logs now respect
the per-component and global LIVE_LOGGING configuration. Error-level
console.error calls are intentionally kept as-is.

https://claude.ai/code/session_01EUCPXXmAWMM4NLiYD6jVPc
LiveLogger now emits all liveLog/liveWarn calls to the Live Debugger
as LOG events (with category, level, message, and details). This
happens whenever DEBUG_LIVE is enabled, regardless of LIVE_LOGGING
console setting. The debug panel shows all infrastructure logs
(websocket connections, state signing, file uploads, etc.) while
the server console stays clean by default.

https://claude.ai/code/session_01EUCPXXmAWMM4NLiYD6jVPc
Previously defaulted to true in development, flooding the debug panel.
Now silent by default — enable explicitly with DEBUG_LIVE=true.

https://claude.ai/code/session_01EUCPXXmAWMM4NLiYD6jVPc
LiveCounter had static logging enabled for lifecycle, messages, state,
and rooms — causing noisy output on every mount/state sign. Commented
out so the demo component is silent by default. Developers can
uncomment it when debugging specific components.

https://claude.ai/code/session_01EUCPXXmAWMM4NLiYD6jVPc
The debug panel (DEBUG_LIVE) now captures all live component logs,
making per-component static logging unnecessary for debugging.

https://claude.ai/code/session_01EUCPXXmAWMM4NLiYD6jVPc
Container uses items-stretch so all three cards match the tallest one.
Cards use flex-col with flex-1 on the counter area to center the
number vertically and push buttons/footer to the bottom.

https://claude.ai/code/session_01EUCPXXmAWMM4NLiYD6jVPc
Document the DEBUG_LIVE debug panel integration, LOG event type,
and recommend DEBUG_LIVE over static logging for debugging.

https://claude.ai/code/session_01EUCPXXmAWMM4NLiYD6jVPc
@MarcosBrendonDePaula MarcosBrendonDePaula merged commit 4cb32a1 into main Feb 22, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants