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

prefer log.warning() in conda.gateways.repodata #13108

Merged
merged 1 commit into from
Sep 18, 2023
Merged

Conversation

dholth
Copy link
Contributor

@dholth dholth commented Sep 15, 2023

Description

Follow-up on #13056. Is it better to use log.warning() over warnings.warn()?

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@dholth dholth requested a review from jezdez September 15, 2023 13:24
@dholth dholth requested a review from a team as a code owner September 15, 2023 13:24
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Sep 15, 2023
@dholth dholth merged commit d328e74 into main Sep 18, 2023
69 checks passed
@dholth dholth deleted the 13056-log-not-warn branch September 18, 2023 21:00
warnings.warn(f"{e.__class__.__name__} loading {self.cache_path_state}")
log.warning(f"{e.__class__.__name__} loading {self.cache_path_state}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main difference is that warnings.warn will only show up once for the same parameter, while log.warning will emit to the configured log output every occurrence. More infos: https://stackoverflow.com/a/37979724

@jezdez jezdez mentioned this pull request Sep 26, 2023
92 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants