Add per-component logging control for Live Components#58
Merged
MarcosBrendonDePaula merged 6 commits intomainfrom Feb 12, 2026
Merged
Add per-component logging control for Live Components#58MarcosBrendonDePaula merged 6 commits intomainfrom
MarcosBrendonDePaula merged 6 commits intomainfrom
Conversation
Replace all console.log calls in live component infrastructure with a centralized LiveLogger that gates output based on per-component config. Components are now silent by default — developers opt-in via static logging property (true for all categories, or array of specific ones). Global (non-component) logs controlled by LIVE_LOGGING env var. Categories: lifecycle, messages, state, performance, rooms, websocket https://claude.ai/code/session_013UpdCKDUobQ4Vn3fBeBeBN
Allow `as const` usage on static logging property without type errors. https://claude.ai/code/session_013UpdCKDUobQ4Vn3fBeBeBN
- Fix date typo in live-upload.md (2026 → 2025) - Update INDEX.md version to 1.12.1 (match package.json) - Add setState function updater and setValue docs to live-components.md - Complete reserved state property names list https://claude.ai/code/session_013UpdCKDUobQ4Vn3fBeBeBN
Explains the two-layer auto-sync system (Proxy + direct accessors), how STATE_DELTA is emitted, and when to use setState for batching. https://claude.ai/code/session_013UpdCKDUobQ4Vn3fBeBeBN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a comprehensive logging system for Live Components that enables fine-grained, per-component control over debug output. Components are silent by default and opt-in to logging via a
static loggingproperty, with support for category-based filtering and global configuration via environment variables.Key Changes
New
LiveLoggermodule (core/server/live/LiveLogger.ts):liveLog()andliveWarn()functions gated by component configurationlifecycle,messages,state,performance,rooms,websocketLIVE_LOGGINGenvironment variable (supportstrue,false, or comma-separated categories)Updated
LiveComponentbase class (core/types/types.ts):static loggingproperty for per-component configurationboolean(all categories) orreadonly LiveLogCategory[](specific categories)undefined/false(silent)Integrated logging throughout Live Components framework:
ComponentRegistry: Registers/unregisters component logging on mount/unmount; replacedconsole.logcalls withliveLog()websocket-plugin.ts: Logs WebSocket connection events, authentication, and message handlingStateSignature.ts: Logs state signing, compression, encryption, and validationLiveComponentPerformanceMonitor.ts: Logs performance alerts and optimization suggestionsLiveRoomManager.ts: Logs room lifecycle events (create, join, leave)LiveComponentmethods: Logs broadcast and room event operationsDocumentation:
LLMD/resources/live-logging.mdwith comprehensive usage guide, category reference, and examplesLLMD/config/environment-vars.mdwithLIVE_LOGGINGvariable documentationLLMD/INDEX.mdto link to logging documentationapp/server/live/LiveCounter.ts) with logging enabledExports: Added
liveLog,liveWarn,registerComponentLogging,unregisterComponentLoggingtocore/server/live/index.tsImplementation Details
static loggingpropertyas constpattern for category arrays to ensure type safetyLIVE_LOGGINGenv var is parsed once and cachedshouldLog()checks registry before any console outputconsole.erroralways visible: Error-level logs are not gated by configurationhttps://claude.ai/code/session_013UpdCKDUobQ4Vn3fBeBeBN