dtcenter / MET

Model Evaluation Tools
https://dtcenter.org/community-code/model-evaluation-tools-met
Apache License 2.0
78 stars 24 forks source link

Separate the log messages for user and developers #2671

Open hsoh-u opened 1 year ago

hsoh-u commented 1 year ago

Replace italics below with details for this issue.

Describe the Enhancement

MET produces "DEBUG D: " depending on the verbose level. They are useful to MET users. MET users may be confused with higher level log messages (over 5) because they are for the developers. I suggest 1) to separate the log messages for MET users and for the developers and 2) do not expose the debug messages for the developers to MET users. The way to activate the debug message will be introduced. One option is by defining the environment variable, MET_ENABLE_DEBUG_MESSAGE along with MACRO for the verbose control.

Note: The current messages are controlled by using "Debug(D)" macro. This may be changed to "Log(D)" or "Info(D)". And use "Debug(D)" for the debug message (messages for the developers).

log message for MET users

DEBUG 1: Default Config File: /d1/personal/hsoh/git/features/feature_2231_unstructured_grid/MET/share/met/config/PointStatConfig_default
DEBUG 1: User Config File: /d1/personal/hsoh/git/features/feature_2231_unstructured_grid/MET/internal/test_unit/config/PointStatConfig_PHYS
==>
INFO 1: Default Config File: /d1/personal/hsoh/git/features/feature_2231_unstructured_grid/MET/share/met/config/PointStatConfig_default
INFO 1: User Config File: /d1/personal/hsoh/git/features/feature_2231_unstructured_grid/MET/internal/test_unit/config/PointStatConfig_PHYS

Consider verbose up to 5 are for the MET users. and 6 or above are for the developers. But some messages for developers may be useful to MET users too.

Target:         Source code -> generated message
MET users:       Info(D)    -> INFO(D): <log_message>
Developers only: Debug(D)   -> DEBUG(D): <log_message>
Both:            Info(D) || Debug(D) -> DEBUG(D): <log_message>
              OR Info(D),Debug(D)

Time Estimate

Estimate the amount of work required here. 3 days for switching messages and add new capability plus extra days to sort out user messages and real debug messages

Sub-Issues

Consider breaking the enhancement down into sub-issues.

Relevant Deadlines

List relevant project deadlines here or state NONE.

Funding Source

Define the source of funding and account keys here or state NONE.

Define the Metadata

Assignee

Labels

Milestone and Projects

Define Related Issue(s)

Consider the impact to the other METplus components.

Enhancement Checklist

See the METplus Workflow for details.

JohnHalleyGotway commented 1 week ago

Recommend comparing MET logging to METplus logging and consider changing MET to make them more consistent. Also recommend defining and documenting a standard for what type of information each integer log level should contain.