Skip to content
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

Limit logging config to CLI #5274

Open
2 of 4 tasks
Tracked by #13862
kenodegard opened this issue Apr 9, 2024 · 0 comments · May be fixed by #5275
Open
2 of 4 tasks
Tracked by #13862

Limit logging config to CLI #5274

kenodegard opened this issue Apr 9, 2024 · 0 comments · May be fixed by #5275
Assignees
Labels
in-progress issue is actively being worked on source::anaconda created by members of Anaconda, Inc. type::tech-debt identifies or resolves some technical debt

Comments

@kenodegard
Copy link
Contributor

Checklist

  • I added a descriptive title
  • I searched open requests and couldn't find a duplicate

What is the idea?

Only apply logging defaults/config when conda-build's CLI entrypoints are called (e.g. the conda_build.cli.main_*.execute functions).

Why is this needed?

Conda-build is not only a CLI application. It is also a library and downstream applications import from it and use the API. This means we should not be setting any logging defaults or otherwise customizing the logging and rather defer to the downstream applications and allow them to control logging as they see fit.

Efforts are already underway to improve conda's logging with much of the same mindset (see conda/conda#13541, conda/conda#13735, and conda/conda#13732).

While working on this we need to beware prior art, e.g., #2106.

What should happen?

  • Remove logging customization that occurs upon import:

    logging.basicConfig(level=logging.INFO)

    # set filelock's logger to only show warnings by default
    logging.getLogger("filelock").setLevel(logging.WARN)
    # quiet some of conda's less useful output
    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)

  • Only "initialize" logging when conda-build CLI entrypoints are invoked.

Additional Context

No response

@kenodegard kenodegard added source::anaconda created by members of Anaconda, Inc. type::tech-debt identifies or resolves some technical debt in-progress issue is actively being worked on labels Apr 9, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in 🧭 Planning Apr 9, 2024
@kenodegard kenodegard moved this from 🆕 New to 🏗️ In Progress in 🧭 Planning Apr 9, 2024
@kenodegard kenodegard linked a pull request Apr 9, 2024 that will close this issue
3 tasks
@kenodegard kenodegard self-assigned this Apr 16, 2024
@kenodegard kenodegard moved this from 🏗️ In Progress to 👀 In Review in 🧭 Planning Apr 16, 2024
@kenodegard kenodegard moved this from 👀 In Review to 🏗️ In Progress in 🧭 Planning Apr 19, 2024
@kenodegard kenodegard assigned jaimergp and unassigned jaimergp May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-progress issue is actively being worked on source::anaconda created by members of Anaconda, Inc. type::tech-debt identifies or resolves some technical debt
Projects
Status: 🏗️ In Progress
Development

Successfully merging a pull request may close this issue.

2 participants