Suppress informational log messages in TUI mode#26
Merged
Conversation
All log messages used console.error() which renders as red text in the TUI, making routine status messages (distillation, pruning, consolidation) look like errors. This confuses users who don't know if something is wrong. Add src/log.ts with three levels: - log.info(): suppressed by default, shown with LORE_DEBUG=1 - log.warn(): suppressed by default, shown with LORE_DEBUG=1 - log.error(): always visible (actual failures) Replace all console.error() calls with the appropriate level: - Informational (log.info): imported knowledge, pruned entries, incremental distillation, context overflow recovery steps, consolidation results, temporal pruning stats - Warnings (log.warn): dropping trailing assistant messages - Errors (log.error): import/export failures, distillation errors, curator errors, consolidation errors, pruning errors, recovery failures
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.
Problem
All lore log messages used
console.error()which writes to stderr. The TUI renders stderr as red error text, making routine status messages look like alarming errors to users:Examples seen in the wild:
[lore] incremental distillation: 54 undistilled messages in ses_3502bf6e2ffe[lore] pruned 9 oversized knowledge entries (confidence set to 0)Solution
Added
src/log.tswith three levels:log.info()log.warn()log.error()Set
LORE_DEBUG=1to see all messages when debugging the plugin.Changes
src/log.ts— lightweight logger with LORE_DEBUG gatingsrc/index.ts— 18console.errorcalls replaced with appropriate log levelsrc/distillation.ts— 1console.error→log.info