Skip to content

feat(config): add option to control debug log printing for loaded con…#3755

Open
aide-cloud wants to merge 2 commits intogo-kratos:mainfrom
aide-family:feature/config
Open

feat(config): add option to control debug log printing for loaded con…#3755
aide-cloud wants to merge 2 commits intogo-kratos:mainfrom
aide-family:feature/config

Conversation

@aide-cloud
Copy link
Copy Markdown

@aide-cloud aide-cloud commented Nov 28, 2025

feat(config): add option to control debug log printing for loaded configs

Adds a new WithPrintLoadedDebugLog option to allow users to enable or disable the debug logging of loaded configuration keys. This option defaults to false, ensuring no additional logs are printed unless explicitly enabled. The change also includes corresponding tests and updates to the config loading logic.

Close #3754

…figs

Adds a new `WithPrintLoadedDebugLog` option to allow users to enable or disable
the debug logging of loaded configuration keys. This option defaults to false,
ensuring no additional logs are printed unless explicitly enabled. The change
also includes corresponding tests and updates to the config loading logic.

Closed go-kratos#3754
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 28, 2025
@kratos-ci-bot
Copy link
Copy Markdown
Collaborator

kratos-ci-bot commented Nov 28, 2025

⚠️ Non-English comments were found in the following locations:


Add a new configuration option `printLoadedDebugLog` that allows
controlling whether the loaded configuration is printed in the debug
log. The default value is set to true to maintain backward compatibility.

The new option can be configured using the `WithPrintLoadedDebugLog`
function which accepts a boolean parameter to enable or disable the
debug log printing of loaded configurations.
@shenqidebaozi
Copy link
Copy Markdown
Member

Just use log level control directly, this setting should not be added

@aide-cloud
Copy link
Copy Markdown
Author

There is a scenario where the logs need to be initialized based on the configuration content. In this case, managing log printing during configuration loading by controlling the log level will become ineffective.

@shenqidebaozi
Copy link
Copy Markdown
Member

There is a scenario where the logs need to be initialized based on the configuration content. In this case, managing log printing during configuration loading by controlling the log level will become ineffective.

But it will only print once

@aide-cloud
Copy link
Copy Markdown
Author

We do not want the loaded configuration information to be exposed in the console. Therefore, we prefer it to have an explicit switch to control it. This PR retains the original default scenario and does not cause any logical damage to the previous version.

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

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add a switch to support the debug of the "config loaded" information during configuration loading and enable the option to freely turn it off.

3 participants