-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolves the duplicate logs issue #1164
Conversation
hi @qizhuli ,please fix the CI |
…em to satisfy the unit tests
@zhouzaida Hi there. I have revised my PR to satisfy the tests. Now it sets any StreamHandler associated with the root logger to log at the ERROR level (instead of NOTSET by default). Over the past few days, I did a little more searching on this matter, and it seems to me that the cleanest solution would be to do |
Codecov Report
@@ Coverage Diff @@
## master #1164 +/- ##
==========================================
- Coverage 68.01% 67.98% -0.04%
==========================================
Files 159 159
Lines 10421 10429 +8
Branches 1895 1899 +4
==========================================
+ Hits 7088 7090 +2
- Misses 2966 2969 +3
- Partials 367 370 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Adds a more detailed explanation in comments
Can be merged after verification in downstream repos like MMSeg/MMDet |
Motivation
The console handler present in the root logger leads to duplicate messages being printed on the console, creating unnecessary clutter. This has also been discussed here. This PR fixes this issue, and resolves #1000.
Modification
In
mmcv.utils.get_logger()
, allStreamHandler
present in the root logger are set to log at theERROR
level, instead ofNOTSET
which is the default.