Fix: keep internal runtime logs silent unless debug log is enabled#38
Fix: keep internal runtime logs silent unless debug log is enabled#38guysmoilov wants to merge 3 commits intomainfrom
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughModified the file logger to return a no-op logger when debug logging is disabled, silencing internal runtime logs by default. Added tests verifying silent mode operation and file-based logging functionality when a debug log path is configured. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
User description
Summary
Testing
Closes #37
PR Type
Bug fix, Tests
Description
Replace console with no-op logger when debug log disabled
Prevent internal runtime logs from appearing in stdout/stderr
Add comprehensive unit tests for logger behavior
Diagram Walkthrough
flowchart LR A["createLogger called"] --> B{"logFilePath provided?"} B -->|No| C["Return NOOP_LOGGER"] B -->|Yes| D["Return file-backed logger"] C --> E["Silent operation"] D --> F["Write to file"]File Walkthrough
file-logger.ts
Implement no-op logger for silent default behaviorsrc/backend/util/file-logger.ts
NOOP_LOGGERconstant with no-op implementations ofloganderrormethods
createLoggerto returnNOOP_LOGGERinstead ofconsolewhen nolog file path is provided
configured
file-logger.test.ts
Add unit tests for logger silent and file modestests/backend/file-logger.test.ts
path is provided
Changes
src/backend/util/file-logger.ts
tests/backend/file-logger.test.ts (new file)
Adds tests covering:
No public API or exported-signature changes.