-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Add EMCC_LOGGING=0 to disable all logging #19531
Changes from all commits
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 |
---|---|---|
|
@@ -29,9 +29,14 @@ | |
# Configure logging before importing any other local modules so even | ||
# log message during import are shown as expected. | ||
DEBUG = int(os.environ.get('EMCC_DEBUG', '0')) | ||
EMCC_LOGGING = int(os.environ.get('EMCC_LOGGING', '1')) | ||
log_level = logging.ERROR | ||
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. should this be WARN by default? (what was the default before? do we actually use WARN?) 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. EMCC_LOGGING default to 1, so the default here is, and was before,
|
||
if DEBUG: | ||
log_level = logging.DEBUG | ||
elif EMCC_LOGGING: | ||
log_level = logging.INFO | ||
# can add %(asctime)s to see timestamps | ||
logging.basicConfig(format='%(name)s:%(levelname)s: %(message)s', | ||
level=logging.DEBUG if DEBUG else logging.INFO) | ||
logging.basicConfig(format='%(name)s:%(levelname)s: %(message)s', level=log_level) | ||
colored_logger.enable() | ||
|
||
from .utils import path_from_root, exit_with_error, safe_ensure_dirs, WINDOWS | ||
|
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.
This feels a bit odd to me. It disables logging, but the test wants to check that there is no problem that causes logging. So it is really a test for the flag disabling logging, but not for the problems that can cause logging existing or not.
In practice most of those warnings are from clang, which
EMCC_LOGGING
doesn't handle. So I'm not too worried here in practice, I guess.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.
EMCC_LOGGING
only effect logging.. which is completely separate to the warnings system.EMCC_LOGGING
does not effect warnings.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.
I see. That's less worrying to me then.
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.
Perhaps its a little confusing... that emscripten uses both python's logging module and also its own "diagnostics.py" module?