Skip to content

Conversation

@ela-kotulska-frequenz
Copy link
Contributor

@ela-kotulska-frequenz ela-kotulska-frequenz commented Nov 21, 2024

Setting log level for root logger with method logging.basicConfig during runtime is not working. Instead logging.getLogger() is used.

@ela-kotulska-frequenz ela-kotulska-frequenz added type:bug Something isn't working part:config Affects the configuration management labels Nov 21, 2024
@ela-kotulska-frequenz ela-kotulska-frequenz self-assigned this Nov 21, 2024
@ela-kotulska-frequenz ela-kotulska-frequenz requested a review from a team as a code owner November 21, 2024 13:49
@github-actions github-actions bot added the part:docs Affects the documentation label Nov 21, 2024
llucax
llucax previously approved these changes Nov 21, 2024
Copy link
Contributor

@llucax llucax left a comment

Choose a reason for hiding this comment

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

Interesting.

This function does nothing if the root logger already has handlers configured, unless the keyword argument force is set to True.

https://docs.python.org/3/library/logging.html#logging.basicConfig

So the format and date format will also not be affected if someone called basicConfig before the actor is instantiated. Maybe we should document this behaviour.

@ela-kotulska-frequenz
Copy link
Contributor Author

Maybe we should document this behaviour.

Good idea. Documentation added

Setting log level with method `logging.basicConfig` during
runtime is not working. Instead logging.getLogger() is used.

Signed-off-by: Elzbieta Kotulska <[email protected]>
@ela-kotulska-frequenz ela-kotulska-frequenz added this pull request to the merge queue Nov 22, 2024
@llucax llucax added this to the v1.0.0-rc1301 milestone Nov 22, 2024
Merged via the queue into frequenz-floss:v1.x.x with commit 8a2702f Nov 22, 2024
18 checks passed
@ela-kotulska-frequenz ela-kotulska-frequenz deleted the logging branch November 22, 2024 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:config Affects the configuration management part:docs Affects the documentation type:bug Something isn't working

Projects

Development

Successfully merging this pull request may close these issues.

2 participants