-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
fix: default logging #27777
fix: default logging #27777
Changes from 4 commits
ed26bf1
527aa05
1f808f3
22ae88f
34007cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,17 +41,7 @@ def configure_logging( | |
if app_config["SILENCE_FAB"]: | ||
logging.getLogger("flask_appbuilder").setLevel(logging.ERROR) | ||
|
||
# configure superset app logger | ||
superset_logger = logging.getLogger("superset") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have to admit I don't like this section that ties a bunch of behaviors to "debug_mode" potentially overriding I feel this needs more thinking/refactoring. One option would be to move the DEBUG/LOG_LEVEL entanglement into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think that's a very good idea. It is technically a breaking change, but only for debug-level environments so should be acceptable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I can move this addition to a separate PR if it requires further discussion.) |
||
if debug_mode: | ||
superset_logger.setLevel(logging.DEBUG) | ||
else: | ||
# In production mode, add log handler to sys.stderr. | ||
superset_logger.addHandler(logging.StreamHandler()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm unclear on what this does ^^^, but if it does anything that's not the default behavior, removing this line could affect people's production env and is a breaking change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See the PR description under "Cause of duplicate logging" - by default |
||
superset_logger.setLevel(logging.INFO) | ||
|
||
logging.getLogger("pyhive.presto").setLevel(logging.INFO) | ||
jessie-ross marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# basicConfig() will set up a default StreamHandler on stderr | ||
logging.basicConfig(format=app_config["LOG_FORMAT"]) | ||
logging.getLogger().setLevel(app_config["LOG_LEVEL"]) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we want this, do we? I think I put that in originally because it was littering the CLI with very verbose output...
I just tried setting it to
False
and got hundreds of lines like: