Skip to content

[log] Add debug logger to config feature registration framework#1228

Merged
lpcox merged 1 commit intomainfrom
add-logger-config-feature-c4fe849f4101d1a9
Feb 21, 2026
Merged

[log] Add debug logger to config feature registration framework#1228
lpcox merged 1 commit intomainfrom
add-logger-config-feature-c4fe849f4101d1a9

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Summary

Adds a debug logger (logFeature) to internal/config/config_feature.go, which implements the modular feature registration framework for configuration loading.

Changes

File modified: internal/config/config_feature.go

Added 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 setters
  • applyStdinConverters: logs before and after dispatching to all registered converters

Why 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:

  • Which features have registered their defaults/converters
  • How many setters/converters are active at startup
  • Whether defaults are being applied during config loading

With DEBUG=config:* enabled, developers can now see the full feature registration lifecycle.

Example debug output

config:feature Registered defaults setter: total=1
config:feature Registered stdin converter: total=1
config:feature Applying 1 default setter(s)
config:feature All default setters applied
config:feature Applying 1 stdin converter(s)
config:feature All stdin converters applied

Testing

  • No test files modified
  • Logger arguments have no side effects (only len() and literal strings used)
  • Follows pkg:filename naming convention (config:feature)
  • Reuses existing logger.New() pattern from config:validation, config:validation_env, config:validation_schema

AI generated by Go Logger Enhancement

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>
@github-actions github-actions Bot added automation enhancement New feature or request labels Feb 21, 2026
@lpcox lpcox marked this pull request as ready for review February 21, 2026 18:37
Copilot AI review requested due to automatic review settings February 21, 2026 18:37
@lpcox lpcox merged commit ce1686b into main Feb 21, 2026
2 checks passed
@lpcox lpcox deleted the add-logger-config-feature-c4fe849f4101d1a9 branch February 21, 2026 18:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 logFeature debug logger with config:feature namespace
  • Added registration logging to RegisterDefaults and RegisterStdinConverter (with running counts)
  • Added before/after logging to applyDefaults and applyStdinConverters dispatcher functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants