Skip to content

Change version warning output to not use logging#4931

Merged
jgfouca merged 1 commit intomasterfrom
jgfouca/fix_logging
Feb 11, 2026
Merged

Change version warning output to not use logging#4931
jgfouca merged 1 commit intomasterfrom
jgfouca/fix_logging

Conversation

@jgfouca
Copy link
Copy Markdown
Contributor

@jgfouca jgfouca commented Feb 11, 2026

Importing logging before CIME.utils.stop_buffering_output makes all the logging.info outputs look terrible. Example:

INFO:CIME.test_scheduler:create_test will use up to 80 cores simultaneously
create_test will use up to 80 cores simultaneously

So, the output is duplicated and one of the duplications has ugly prefix text.

This is somewhat urgent as it impacts all users. I will do an emergency CIME update to E3SM when this is merged.

Checklist

  • My code follows the style guidelines of this project (black formatting)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that exercise my feature/fix and existing tests continue to pass
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding additions and changes to the documentation

Importing logging before CIME.utils.stop_buffering_output makes all the
logging.info outputs look terrible. Example:

INFO:CIME.test_scheduler:create_test will use up to 80 cores simultaneously
create_test will use up to 80 cores simultaneously
@jgfouca jgfouca force-pushed the jgfouca/fix_logging branch from a331c84 to 9b339c3 Compare February 11, 2026 20:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a logging output duplication issue where importing the logging module before calling CIME.utils.stop_buffering_output() causes duplicate log messages with ugly prefix text. The fix moves the logging import to after the stop_buffering_output() call and replaces the early warning output with a direct print to stderr.

Changes:

  • Moved logging import from line 7 to line 54 (after stop_buffering_output is called)
  • Changed Python version warning output from logging.warning to print to stderr

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


CIME.utils.stop_buffering_output()
import argparse
import argparse, logging
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

Import of 'logging' is not used.
Import of 'argparse' is not used.

Suggested change
import argparse, logging

Copilot uses AI. Check for mistakes.
@jgfouca jgfouca merged commit 7997bb9 into master Feb 11, 2026
15 checks passed
@jgfouca jgfouca deleted the jgfouca/fix_logging branch February 11, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants