[log] Add debug logger to config feature registration framework#1228
Merged
[log] Add debug logger to config feature registration framework#1228
Conversation
Add a debug logger (logFeature) to internal/config/config_feature.go to provide visibility into the feature registration and dispatch lifecycle: - Log when defaults setters are registered (with running count) - Log when stdin converters are registered (with running count) - Log when applyDefaults dispatches to all registered setters - Log when applyStdinConverters dispatches to all registered converters This helps trace which config features are active and in what order defaults and converters are applied during configuration loading. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds debug logging to the feature registration framework in internal/config/config_feature.go, enabling developers to trace which configuration features register themselves at startup and when their defaults/converters are applied during config loading.
Changes:
- Added
logFeaturedebug logger withconfig:featurenamespace - Added registration logging to
RegisterDefaultsandRegisterStdinConverter(with running counts) - Added before/after logging to
applyDefaultsandapplyStdinConvertersdispatcher functions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Adds a debug logger (
logFeature) tointernal/config/config_feature.go, which implements the modular feature registration framework for configuration loading.Changes
File modified:
internal/config/config_feature.goAdded
logger.New("config:feature")and 6 logging calls:RegisterDefaults: logs when a new defaults setter is registered (with running count)RegisterStdinConverter: logs when a new stdin converter is registered (with running count)applyDefaults: logs before and after dispatching to all registered settersapplyStdinConverters: logs before and after dispatching to all registered convertersWhy this file?
This file is the central dispatch hub for modular config features. It had no debug logging at all, making it impossible to trace:
With
DEBUG=config:*enabled, developers can now see the full feature registration lifecycle.Example debug output
Testing
len()and literal strings used)pkg:filenamenaming convention (config:feature)logger.New()pattern fromconfig:validation,config:validation_env,config:validation_schema