From 9107fc664258a5c7106dc6468bf0b4e048eb0c53 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Tue, 5 Dec 2023 15:11:04 -0700 Subject: [PATCH] Per #2701, every time I run ascii2nc to I see a log message for 'DEBUG 1: Number of NDBC skipped files due to no lookup 0'. This is printed by the NdbcHandler destructor. Update the logic to only print a debug level 3 log message when the number of missing locations is greater than 0, 'DEBUG 3: Skipped 5 NDBC files whose locations are not defined in 'MET_BASE/table_files/ndbc_stations.xml'. Set the MET_NDBC_STATIONS environment variable to override this file.' --- src/tools/other/ascii2nc/ndbc_handler.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/tools/other/ascii2nc/ndbc_handler.cc b/src/tools/other/ascii2nc/ndbc_handler.cc index 9ec04255a2..98025a1ae1 100644 --- a/src/tools/other/ascii2nc/ndbc_handler.cc +++ b/src/tools/other/ascii2nc/ndbc_handler.cc @@ -120,8 +120,15 @@ NdbcHandler::NdbcHandler(const string &program_name) : NdbcHandler::~NdbcHandler() { - mlog << Debug(1) << "Number of NDBC skipped files due to no lookup " << numMissingStations - << "\n"; + + // Log the non-zero number of missing stations + if(numMissingStations > 0) { + mlog << Debug(3) << "Skipped " << numMissingStations + << " NDBC files whose locations are not defined in \"" + << locationsFileName << "\". Set the " << stations_env + << " environment variable to provide an updated " + << "locations file.\n"; + } }