feat: add LOG_LEVEL_V2 with getLogLevel() and logger integrations#29
Merged
feat: add LOG_LEVEL_V2 with getLogLevel() and logger integrations#29
Conversation
Implements dynamic log level control using LOG_LEVEL_V2 config type. Core Features: - Add getLogLevel(loggerName) method to Reforge and Resolver - Add ConfigType.LogLevelV2 enum value - Add loggerKey option (defaults to 'log-levels.default') - Evaluates log level with context: reforge-sdk-logging.logger-path - Returns DEBUG as default when config not found - No hierarchy traversal (unlike v1 implementation) Logger Integrations (Optional Peer Dependencies): - Pino integration: createPinoLogger(), createPinoHook() - Winston integration: createWinstonLogger(), createWinstonFormat() - Dynamic import with graceful degradation - Auto-skip integration tests when libs not installed - Support pino >=7.0.0, winston >=3.0.0 Tests: - 11 new tests for getLogLevel() functionality - 11 integration tests (auto-skip without pino/winston) - All 529 existing tests pass Documentation: - INTEGRATIONS.md with complete usage examples - README.md updated with getLogLevel() and loggerKey option - Configuration instructions and level mapping tables 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
4bc837d to
3dc9415
Compare
- Add @types/node to devDependencies to satisfy ts-node peer dependency - Replace @ts-ignore with @ts-expect-error in pino and winston integrations - Fixes linter errors and peer dependency warnings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Release includes: - LOG_LEVEL_V2 with getLogLevel() and logger integrations - Pino and Winston logger integrations - Bug fixes and dependency updates 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add prominent link to https://docs.reforge.com/docs/sdks/node at the top of README 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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
Implements dynamic log level control using the new
LOG_LEVEL_V2config type withgetLogLevel()method and optional integrations for popular logging frameworks.Core Features
getLogLevel(loggerName): LogLevel- New method to retrieve log levels from LOG_LEVEL_V2 configsConfigType.LogLevelV2- New config type for v2 log level systemloggerKeyoption - Defaults to"log-levels.default", specifies which config to evaluatereforge-sdk-logging.logger-pathcontext for targetingDEBUGas default when config not foundLogger Integrations (Optional Peer Dependencies)
pino >=7.0.0)createPinoLogger()- Create logger with dynamic levelscreatePinoHook()- Mixin for existing loggerswinston >=3.0.0)createWinstonLogger()- Create logger with dynamic levelscreateWinstonFormat()- Format for existing loggersDocumentation
getLogLevel()method andloggerKeyoptionTesting
getLogLevel()functionalityBreaking Changes
None - All additions are backward compatible
Test plan
🤖 Generated with Claude Code