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

Use more template-specific language in log messages #542

Merged

Conversation

maddenp-noaa
Copy link
Contributor

@maddenp-noaa maddenp-noaa commented Jul 23, 2024

Synopsis

Use more template-specific language in log messages when rendering templates.

For example, the upcoming new CDEPS driver calls on existing uwtools template-rendering mechanisms to create streams files from Jinja2 template files. In a recent failure, uw logged the following:

(DEV-uwtools) ~/git/uwtools $ uw cdeps atm --cycle 20240201T18:00:00 --config-file config.yaml
[2024-07-23T18:32:14]     INFO Validating config against internal schema cdeps
[2024-07-23T18:32:14]     INFO 0 UW schema-validation errors found
[2024-07-23T18:32:14]     INFO 20240201 18Z cdeps data atmosphere configuration: Initial state: Not Ready
[2024-07-23T18:32:14]     INFO 20240201 18Z cdeps data atmosphere configuration: Checking requirements
[2024-07-23T18:32:14]     INFO 20240201 18Z cdeps namelist file datm_in: Initial state: Not Ready
[2024-07-23T18:32:14]     INFO 20240201 18Z cdeps namelist file datm_in: Checking requirements
[2024-07-23T18:32:14]     INFO 20240201 18Z cdeps namelist file datm_in: Requirement(s) ready
[2024-07-23T18:32:14]     INFO 20240201 18Z cdeps namelist file datm_in: Executing
[2024-07-23T18:32:14]     INFO 0 UW schema-validation errors found
[2024-07-23T18:32:14]     INFO 20240201 18Z cdeps namelist file datm_in: Final state: Ready
[2024-07-23T18:32:14]     INFO 20240201 18Z cdeps stream file datm.streams: Initial state: Not Ready
[2024-07-23T18:32:14]     INFO 20240201 18Z cdeps stream file datm.streams: Checking requirements
[2024-07-23T18:32:14]     INFO 20240201 18Z cdeps stream file datm.streams: Requirement(s) ready
[2024-07-23T18:32:14]     INFO 20240201 18Z cdeps stream file datm.streams: Executing
[2024-07-23T18:32:14]    ERROR Required value(s) not provided:
[2024-07-23T18:32:14]    ERROR   streams
[2024-07-23T18:32:14]  WARNING 20240201 18Z cdeps data atmosphere configuration: Final state: Not Ready

In the lines

[2024-07-23T18:32:14]    ERROR Required value(s) not provided:
[2024-07-23T18:32:14]    ERROR   streams

it's unclear what the context is. Values required by what? The new message would read

[2024-07-23T18:32:14]    ERROR Value(s) required to render template not provided:
[2024-07-23T18:32:14]    ERROR   streams

This would have clarified, for me, the source of the error. Similar updates to related log messages are also made.

The old messages might have been sufficient in the context of running e.g. uw template render, but when rendering is requested from other contexts, hopefully these updated messages will be clearer.

Also: Add badges showing GitHub Actions status for test and release workflows.

Type

  • Code maintenance (refactoring, etc. without behavior change)

Impact

  • This is a non-breaking change (existing functionality continues to work as expected)

Checklist

  • I have added myself and any co-authors to the PR's Assignees list.
  • I have reviewed the documentation and have made any updates necessitated by this change.

@maddenp-noaa maddenp-noaa self-assigned this Jul 23, 2024
@maddenp-noaa maddenp-noaa merged commit cfd6924 into ufs-community:main Jul 24, 2024
2 checks passed
@maddenp-noaa maddenp-noaa deleted the better-template-render-logging branch July 24, 2024 02:40
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.

3 participants