Skip to content

Conversation

@eternalNight
Copy link
Contributor

After #7526 the default logger passes logs to a StreamHandler, which has its own log level. Changing the log level of the logger alone does not take effect in such case.

Update the log level of all handlers when changing the parent logger's.

Copy link
Collaborator

@stas00 stas00 left a comment

Choose a reason for hiding this comment

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

Thank you for this improvement, @eternalNight

For some reason I can't push into your PR, so please also change the function docstring to reflect this change. Suggesting:

   """Sets a log level in the passed `logger` and its handlers from string. e.g. "info" => `logging.INFO`

@eternalNight eternalNight force-pushed the eternalNight/fix_log_level_setting branch from 6d41880 to 3c95858 Compare September 23, 2025 01:04
After deepspeedai#7526 the default logger passes logs to a StreamHandler, which has
its own log level. Changing the log level of the logger alone does not
take effect in such case.

Update the log level of all handlers when changing the parent logger's.

Signed-off-by: Junjie Mao <[email protected]>
@eternalNight eternalNight force-pushed the eternalNight/fix_log_level_setting branch from 3c95858 to 9621c73 Compare September 23, 2025 01:05
@eternalNight
Copy link
Contributor Author

Thank you for this improvement, @eternalNight

For some reason I can't push into your PR, so please also change the function docstring to reflect this change. Suggesting:

   """Sets a log level in the passed `logger` and its handlers from string. e.g. "info" => `logging.INFO`

Docstring updated.

@stas00 stas00 enabled auto-merge (squash) September 23, 2025 03:11
@stas00
Copy link
Collaborator

stas00 commented Sep 23, 2025

Thank you!

@stas00 stas00 merged commit 35de203 into deepspeedai:master Sep 23, 2025
12 checks passed
mauryaavinash95 pushed a commit to DataStates/DeepSpeed that referenced this pull request Oct 4, 2025
After deepspeedai#7526 the default logger passes logs to a StreamHandler, which has
its own log level. Changing the log level of the logger alone does not
take effect in such case.

Update the log level of all handlers when changing the parent logger's.

Signed-off-by: Junjie Mao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants