Removing print and adding a logger#2762
Open
chayim wants to merge 1 commit intodeepinsight:masterfrom
Open
Conversation
|
您好,我已经收到您的邮件,尽快给您回复。
|
|
@nttstar Hi, this PR seems to improve the current logging approach by using a dedicated logger with a INFO default log level which will allow to filter out repetitive, debug logs which usually just clutter the console while allowing to specify an environment variable to see debug logs when needed for debugging. So it would be great if you have time to review this small PR, see if can be merged or needs adjustments. Thanks for your attention! |
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.
Thank you for the awesome project! As part of my use, I noticed a tonne of print statements, whenever I run my tests. This is getting in the way of debugging. As a result, I integrated a logger. For every (non-thirdparty) statement present, I replaced print with log. When the error text indicated a level (eg. warning, error), I used that log level.
When no level was specified I defaulted to DEBUG, which now, will not print.
Should someone want debug, they merely have to set the environment variable
DEBUGto any value.Thanks again for a great project, I hope this is useful to someone else, given #2481