feat(config): add option to control debug log printing for loaded con…#3755
feat(config): add option to control debug log printing for loaded con…#3755aide-cloud wants to merge 2 commits intogo-kratos:mainfrom
Conversation
…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
|
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.
|
Just use log level control directly, this setting should not be added |
|
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 |
|
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. |
feat(config): add option to control debug log printing for loaded configs
Adds a new
WithPrintLoadedDebugLogoption 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