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

Add log output when overriding a global option setting #80

Merged

Conversation

cresswellp
Copy link
Contributor

If a <project>_ENABLE_<feature> variable is used, it's not directly referenced in the ecbuild.log output unless both that and ENABLE_<feature> are present (which triggers a warning). If only the project-specific variable is present and it differs from the default setting, the output can be confusing; for example, if we have ECCODES_ENABLE_NETCDF=OFF:

eccodes - DEBUG - ecbuild_add_option(NETCDF): defaults to ON
eccodes - DEBUG - ecbuild_evaluate_dynamic_condition(_NETCDF_condition): checking condition '' -> TRUE
eccodes - DEBUG - ecbuild_add_option(NETCDF): ENABLE_NETCDF not found in cache
eccodes - DEBUG - ecbuild_add_option(NETCDF): defining option ENABLE_NETCDF 'Support for GRIB to NetCDF conversion' ON
eccodes - DEBUG - ecbuild_add_option(NETCDF): ENABLE_NETCDF=ON
eccodes - DEBUG - ecbuild_add_option(NETCDF): feature disabled # !?!

In the last line the setting is suddenly disabled with no explanation.

The surrounding code has good logging coverage, so a few extra lines here would explain what's going on. This PR inserts a few extra lines of context:

...
eccodes - DEBUG - ecbuild_add_option(NETCDF): ENABLE_NETCDF=ON
eccodes - DEBUG - ecbuild_add_option(NETCDF): found ECCODES_ENABLE_NETCDF=OFF
eccodes - DEBUG - ecbuild_add_option(NETCDF): set ENABLE_NETCDF from ECCODES_ENABLE_NETCDF
eccodes - DEBUG - ecbuild_add_option(NETCDF): ENABLE_NETCDF=OFF
eccodes - DEBUG - ecbuild_add_option(NETCDF): feature disabled

Happy for this to be edited if you think it's now too verbose, but I think at least one extra line here would be useful.

Copy link
Member

@wdeconinck wdeconinck left a comment

Choose a reason for hiding this comment

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

I am very happy with this extra verbose output in DEBUG logging. Thanks @cresswellp !

@wdeconinck wdeconinck merged commit afaf4be into ecmwf:develop Mar 13, 2025
14 checks passed
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.

2 participants