[Log] CLILogging.configure returns as early as possible#228
Merged
jiasli merged 1 commit intomicrosoft:masterfrom Jan 25, 2021
Merged
[Log] CLILogging.configure returns as early as possible#228jiasli merged 1 commit intomicrosoft:masterfrom
jiasli merged 1 commit intomicrosoft:masterfrom
Conversation
Collaborator
|
Log |
evelyn-ys
approved these changes
Jan 25, 2021
fengzhou-msft
approved these changes
Jan 25, 2021
6618199 to
9276c0a
Compare
kairu-ms
approved these changes
Jan 25, 2021
9276c0a to
67ba8c3
Compare
67ba8c3 to
7a5d837
Compare
Merged
jiasli
commented
Mar 2, 2021
Comment on lines
+129
to
+133
| root_logger = logging.getLogger() | ||
|
|
||
| if root_logger.handlers: | ||
| # handlers already configured | ||
| return |
Member
Author
There was a problem hiding this comment.
When run in pytest environment, root_logger is already set by pytest. If we don't return here before cli_logger.propagate = False, cli_logger.propagate = False will take effect and intercepts all logs sent to cli_loggers.
With this change, all logs will be handled by pytest directly.
This was referenced Mar 16, 2021
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Check whether
CLILoggingalready has been configured and return as early as possible, otherwise, calls likeis totally unnecessary and is merely a waste of time.