Skip to content

Show warnings in logs - #3214

Merged
schlunma merged 2 commits into
mainfrom
fix_warnings
Sep 1, 2026
Merged

Show warnings in logs#3214
schlunma merged 2 commits into
mainfrom
fix_warnings

Conversation

@schlunma

@schlunma schlunma commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Description

We use logging.captureWarnings in our logging configuration to show warnings emitted by the warnings module as logging messages. According to the docs, this does the following:

If capture is True, warnings issued by the warnings module will be redirected to the logging system. Specifically, a warning will be formatted using warnings.formatwarning() and the resulting string logged to a logger named 'py.warnings' with a severity of WARNING.

Note the logger name py.warnings. Since #2765, we only show messages from certain loggers. However, the py.warnings logger is missing here, which eventually leads to omitted warnings messages.

This PR adds this. In addition, one instance of a DeprecationWarning is changed to ESMValCoreDeprecationWarning to be consistent with other deprecations.

Closes #3213.


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@schlunma schlunma added this to the v2.16.0 milestone Aug 31, 2026
@schlunma
schlunma requested a review from bouweandela August 31, 2026 11:44
@schlunma schlunma added the bug Something isn't working label Aug 31, 2026
@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.46%. Comparing base (8c8ce25) to head (1b0aa0b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3214      +/-   ##
==========================================
- Coverage   96.48%   96.46%   -0.02%     
==========================================
  Files         281      281              
  Lines       16317    16317              
==========================================
- Hits        15743    15740       -3     
- Misses        574      577       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bouweandela bouweandela left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@schlunma
schlunma merged commit adc6c38 into main Sep 1, 2026
6 checks passed
@schlunma
schlunma deleted the fix_warnings branch September 1, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No warnings are shown anymore

2 participants