Skip to content

Remove duplicate logs - #29

Merged
forsyth2 merged 1 commit into
mainfrom
issue-10-logger
Jul 15, 2025
Merged

Remove duplicate logs#29
forsyth2 merged 1 commit into
mainfrom
issue-10-logger

Conversation

@forsyth2

@forsyth2 forsyth2 commented Jul 4, 2025

Copy link
Copy Markdown
Collaborator

Summary

Follow example of E3SM-Project/e3sm_diags#955 to remove duplicate logger lines. This will be helpful for debugging logs in E3SM-Project/zppy#719 & #25.

Objectives:

  • Remove duplicate logs.

Issue resolution:

Select one: This pull request is...

  • a bug fix: increment the patch version
  • a small improvement: increment the minor version
  • a new feature: increment the minor version
  • an incompatible (non-backwards compatible) API change: increment the major version

Please fill out either the "Small Change" or "Big Change" section (the latter includes the numbered subsections), and delete the other.

Small Change

  • To merge, I will use "Squash and merge". That is, this change should be a single commit.
  • Logic: I have visually inspected the entire pull request myself.
  • Pre-commit checks: All the pre-commits checks have passed.

@forsyth2

forsyth2 commented Jul 4, 2025

Copy link
Copy Markdown
Collaborator Author

Unfortunately, running into #30, which is making it difficult to test if logs are actually working.

@forsyth2 forsyth2 mentioned this pull request Jul 4, 2025
14 tasks
@forsyth2

Copy link
Copy Markdown
Collaborator Author

After addressing #30, I'm actually able to run this, and it looks like the logs do indeed only print once now!

Run details
git checkout issue-10-logger
pre-commit run --all-files
conda clean --all --y
conda env create -f conda/dev.yml -n zi-issue-10-logger-20250710
conda activate zi-issue-10-logger-20250710
python -m pip install .

cd ~/ez/zppy
git checkout test-zi-logging
conda clean --all --y
conda env create -f conda/dev.yml -n zppy-zi-logger-20250710
conda activate zppy-zi-logger-20250710
# Edit tests/integration/utils.py
# UNIQUE_ID = "test-zi-logger-20250710"
#         "global_time_series_environment_commands": "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zi-issue-10-logger-20250710",

python tests/integration/utils.py
python -m pip install .
zppy -c tests/integration/generated/test_weekly_comprehensive_v3_chrysalis.cfg
# WAIT
cd /lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/test-zi-logger-20250710/v3.LR.historical_0051/post/scripts && grep -v "OK" *status
# No error!
emacs global_time_series_1985-1995.o793583
# Looks like logger lines are now only printing once!

@forsyth2

Copy link
Copy Markdown
Collaborator Author

@tomvothecoder @chengzhuzhang Did either of you want to review this, or can I go ahead and merge?

@forsyth2
forsyth2 marked this pull request as ready for review July 11, 2025 01:39

@tomvothecoder tomvothecoder left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm glad only single log messages are now printed. This PR looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Fix logger messages printing multiple times

2 participants