-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Improve logging and API of the config
module
#1133
Merged
Merged
Conversation
This file contains 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
The actor `name` is really just a unique ID, and lacks the class name. For logging is best to use the `str`, which includes both the class name and the ID. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Forwarding keyword arguments looks nice but makes the function typing much weaker. Any typos in the keyword arguments taken by the function end up undetected until they reach `marshmallow.Schema.load()` and then they give an obscure error about some unexpected argument that was never the intention to forward to `marshmallow`. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
The `BackgroundService` should not return early if there are no tasks in `stop()`, as sub-classes could need to implement a custom stopping logic. In this case it should be enough to override the `cancel()` and `wait()` methods, and the `is_running` property. We also add an example of how this could be done. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
The `LoggingConfig` will now create a default root logger that has `INFO` enabled and `INFO` is passed to `logging.basicConfig()`, so user can at least see `INFO` messages during initialization. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Updating loggers config is not that often, and to be able to debug with some confidence, is good to see exactly which loggers were enabled with which levels, so we convert logs about configuring the loggers from debug to info. Now that we are showing how loggers are being configured, there is no need to show the whole new configuration, which could be pretty lengthy. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
ela-kotulska-frequenz
approved these changes
Dec 17, 2024
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
part:actor
Affects an actor ot the actors utilities (decorator, etc.)
part:config
Affects the configuration management
part:docs
Affects the documentation
part:tests
Affects the unit, integration and performance (benchmarks) tests
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.
load_config
keyword arguments keyword-onlymarshmallow
explicit