Skip to content

feat(logger): add configurable log level resolver with environment defaults (#684) - #749

Open
ravendevhub wants to merge 1 commit into
Core-Foundry:mainfrom
ravendevhub:feat/configurable-log-level-684
Open

feat(logger): add configurable log level resolver with environment defaults (#684)#749
ravendevhub wants to merge 1 commit into
Core-Foundry:mainfrom
ravendevhub:feat/configurable-log-level-684

Conversation

@ravendevhub

Copy link
Copy Markdown

Summary

Resolves #684 by introducing a dedicated log level resolver module (listener/src/utils/log-level-resolver.ts) that validates LOG_LEVEL inputs against supported severities (debug, info, warn, error, silent), enforces production defaults (info), and handles invalid entries with deterministic fallback warnings.

Changes

  1. Log Level Resolver (listener/src/utils/log-level-resolver.ts):
    • Resolves log level from environment variables with case-insensitivity and whitespace trimming.
    • Enforces default levels: info in production and debug in development.
    • Replaces invalid configurations with safe defaults accompanied by clear warnings.
  2. Automated Unit Tests (listener/src/utils/log-level-resolver.test.ts):
    • Tests casing normalization, production/development defaults, and invalid fallback handling.
  3. Documentation (docs/CONFIGURABLE_LOG_LEVEL.md):
    • Documents log levels, severity hierarchy, and fallback rules.

Acceptance Criteria

  • Supported log levels are documented.
  • Configuration can be supplied through the existing configuration mechanism.
  • Invalid log levels are rejected.
  • Production defaults remain appropriate.

…faults (Core-Foundry#684)

- Support debug, info, warn, error, and silent log levels
- Implement resolveConfiguredLogLevel with production (info) and dev (debug) defaults
- Gracefully handle invalid inputs with actionable fallback warnings
- Add unit test suite in log-level-resolver.test.ts and docs in docs/CONFIGURABLE_LOG_LEVEL.md
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.

Add Configurable Log Level

1 participant