-
Notifications
You must be signed in to change notification settings - Fork 423
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
Move CLI's logging initialization into a dedicated module #5275
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #5275 will not alter performanceComparing Summary
|
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.
Good idea, just think we should use the logging namespace to interact with the stdlib library instead of importing all those items into the modules
@kenodegard this sadly needs a merge :-/ |
|
||
# set filelock's logger to only show warnings by default | ||
logging.getLogger("filelock").setLevel(logging.WARN) |
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.
AFAIK this is also no longer necessary since we've restored the root logger to warning, see conda_build.cli.logging.init_logging
.
logging.getLogger("conda.core.linked_data").setLevel(logging.WARN) | ||
logging.getLogger("conda.gateways.disk.delete").setLevel(logging.WARN) | ||
logging.getLogger("conda.gateways.disk.test").setLevel(logging.WARN) |
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.
AFAIK this is unnecessary since logging.WARNING
is already the default log level in conda
.
# undo conda messing with the root logger | ||
logging.getLogger(None).setLevel(logging.WARNING) |
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.
To remove this we will first need to remove initialize_root_logger
from conda's log initialization (and then wait some number of conda releases until we can bump up conda-build's minimum conda dependency): https://github.com/conda/conda/blob/eb459543b0c280011216f2f22eedc1c8dcbd4d9f/conda/gateways/logging.py#L142-L147
Description
Refactor
conda_build.utils.get_logger
intoconda_build.cli.logging.init_logging
and only call this initializer when the conda-build CLI entrypoints are invoked. When using conda-build as a library we do not set any logging defaults.Resolves #5274
Xref #5415
Checklist - did you ...
news
directory (using the template) for the next release's release notes?Add / update outdated documentation?