Skip to content

Commit f88df8a

Browse files
authored
Tune and fix some framework logs (#2588)
Minor typo fixes, level tuning and factoring out IL setup.
1 parent 33bf20a commit f88df8a

File tree

6 files changed

+39
-33
lines changed

6 files changed

+39
-33
lines changed

Framework/src/AggregatorRunner.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void AggregatorRunner::store(QualityObjectsWithAggregatorNameVector& qualityObje
214214

215215
if (!qualityObjectsWithAggregatorNames.empty() && !qualityObjectsWithAggregatorNames.front().second.empty()) {
216216
const auto& qo = qualityObjectsWithAggregatorNames.front().second.front();
217-
ILOG(Info, Devel) << "Validity of QO '" << qo->GetName() << "' is (" << qo->getValidity().getMin() << ", " << qo->getValidity().getMax() << ")" << ENDM;
217+
ILOG(Debug, Devel) << "Validity of QO '" << qo->GetName() << "' is (" << qo->getValidity().getMin() << ", " << qo->getValidity().getMax() << ")" << ENDM;
218218
}
219219

220220
} catch (boost::exception& e) {

Framework/src/Bookkeeping.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ std::string readClientToken()
5252
if (token.empty()) {
5353
throw std::runtime_error("BKP token file '" + tokenFileName + "' was provided but it is empty, please provide a valid token");
5454
}
55-
ILOG(Debug, Devel) << "Using token from file qc_bkp_client_token" << ENDM;
55+
ILOG(Debug, Devel) << "Using token from file qc_bkp_client_token.txt" << ENDM;
5656
return token;
5757
}
5858

Framework/src/CheckRunner.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ void CheckRunner::store(QualityObjectsType& qualityObjects, long validFrom)
337337
}
338338
if (!qualityObjects.empty()) {
339339
auto& qo = qualityObjects.at(0);
340-
ILOG(Info, Devel) << "Validity of QO '" << qo->GetName() << "' is (" << qo->getValidity().getMin() << ", " << qo->getValidity().getMax() << ")" << ENDM;
340+
ILOG(Debug, Devel) << "Validity of QO '" << qo->GetName() << "' is (" << qo->getValidity().getMin() << ", " << qo->getValidity().getMax() << ")" << ENDM;
341341
}
342342
} catch (boost::exception& e) {
343343
ILOG(Info, Support) << "Unable to " << diagnostic_information(e) << ENDM;
@@ -356,7 +356,7 @@ void CheckRunner::store(std::vector<std::shared_ptr<MonitorObject>>& monitorObje
356356
}
357357
if (!monitorObjects.empty()) {
358358
auto& mo = monitorObjects.at(0);
359-
ILOG(Info, Devel) << "Validity of MO '" << mo->GetName() << "' is (" << mo->getValidity().getMin() << ", " << mo->getValidity().getMax() << ")" << ENDM;
359+
ILOG(Debug, Devel) << "Validity of MO '" << mo->GetName() << "' is (" << mo->getValidity().getMin() << ", " << mo->getValidity().getMax() << ")" << ENDM;
360360
}
361361
} catch (boost::exception& e) {
362362
ILOG(Info, Support) << "Unable to " << diagnostic_information(e) << ENDM;

Framework/src/TimekeeperAsynchronous.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ validity_time_t
111111
} else {
112112
// an exception could be thrown here once the values above are set correctly in production
113113
}
114-
ILOG(Info, Devel) << "Received the following activity boundary propositions: " << ccdbTimestamp << ", " << ecsTimestamp
115-
<< ", " << configTimestamp << ", " << currentTimestamp << ". Selected: " << selected << ENDM;
114+
ILOG(Debug, Devel) << "Received the following activity boundary propositions: " << ccdbTimestamp << ", " << ecsTimestamp
115+
<< ", " << configTimestamp << ", " << currentTimestamp << ". Selected: " << selected << ENDM;
116116
return selected;
117117
}
118118

@@ -131,7 +131,7 @@ ValidityInterval TimekeeperAsynchronous::computeTimestampFromTimeframeID(uint32_
131131
if (mOrbitsPerTF == 0) {
132132
if (auto accessor = getCCDBOrbitsPerTFAccessor()) {
133133
mOrbitsPerTF = accessor();
134-
ILOG(Info, Support) << "Got nOrbitsPerTF " << mOrbitsPerTF << " for TF " << tfid << ENDM;
134+
ILOG(Debug, Support) << "Got nOrbitsPerTF " << mOrbitsPerTF << " for TF " << tfid << ENDM;
135135
} else {
136136
ILOG(Error, Ops) << "CCDB OrbitsPerTF accessor is not available" << ENDM;
137137
}

Framework/src/TimekeeperSynchronous.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void TimekeeperSynchronous::updateByTimeFrameID(uint32_t tfid)
3737
{
3838
if (tfid == 0) {
3939
if (!mWarnedAboutTfIdZero) {
40-
ILOG(Warning, Devel) << "Seen TFID equal to 0, which is not expected. Will not update TF-based validity, will not warn further." << ENDM;
40+
ILOG(Debug, Devel) << "Seen TFID equal to 0, which is unexpected in production, but normal in test QC setups. Will not update TF-based validity, will not warn further." << ENDM;
4141
mWarnedAboutTfIdZero = true;
4242
}
4343
return;

Framework/src/runQC.cxx

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <boost/asio/ip/host_name.hpp>
3333
#include <DataSampling/DataSampling.h>
3434
#include <Configuration/ConfigurationFactory.h>
35+
#include <Framework/DefaultsHelpers.h>
3536
#include "QualityControl/runnerUtils.h"
3637
#include "QualityControl/InfrastructureGenerator.h"
3738
#include "QualityControl/QcInfoLogger.h"
@@ -108,7 +109,7 @@ bool validateArguments(const ConfigContext& config)
108109
ILOG(Warning, Support) << "No configuration path specified, returning an empty workflow." << ENDM;
109110
return false;
110111
} else if (!std::regex_match(qcConfigurationSource, configBackend)) {
111-
ILOG(Error, Support) << "The --config option expects a backend name (e.g. json:// or consul-json://) preceding the path. User specified: " << qcConfigurationSource << ENDM;
112+
ILOG(Error, Ops) << "The --config option expects a backend name (e.g. json:// or consul-json://) preceding the path. User specified: " << qcConfigurationSource << ENDM;
112113
return false;
113114
}
114115

@@ -119,13 +120,40 @@ bool validateArguments(const ConfigContext& config)
119120
exclusiveOptions += !config.options().get<std::string>("local-batch").empty();
120121
exclusiveOptions += !config.options().get<std::string>("remote-batch").empty();
121122
if (exclusiveOptions > 1) {
122-
ILOG(Error, Support) << "More than one of the following options was specified: --local, --remote, --local-batch, --remote--batch. This is not allowed, returning an empty workflow." << ENDM;
123+
ILOG(Error, Ops) << "More than one of the following options was specified: --local, --remote, --local-batch, --remote-batch, --full-chain. This is not allowed, returning an empty workflow." << ENDM;
123124
return false;
124125
}
125126

126127
return true;
127128
}
128129

130+
void setupInfologger(const ConfigContext& config, boost::property_tree::ptree configTree)
131+
{
132+
if (config.options().get<bool>("no-infologger")) {
133+
quality_control::core::QcInfoLogger::disable();
134+
} else {
135+
auto infologgerFilterDiscardDebug = configTree.get<bool>("qc.config.infologger.filterDiscardDebug", true);
136+
auto infologgerDiscardLevel = configTree.get<int>("qc.config.infologger.filterDiscardLevel", 21);
137+
ILOG_INST.filterDiscardDebug(infologgerFilterDiscardDebug);
138+
ILOG_INST.filterDiscardLevel(infologgerDiscardLevel);
139+
}
140+
auto infologgerDiscardFile = configTree.get<std::string>("qc.config.infologger.filterDiscardFile", "");
141+
auto rotateMaxBytes = configTree.get<u_long>("qc.config.infologger.filterRotateMaxBytes", 0);
142+
auto rotateMaxFiles = configTree.get<u_int>("qc.config.infologger.filterRotateMaxFiles", 0);
143+
std::string debugInDiscardFile = configTree.get<std::string>("qc.config.infologger.debugInDiscardFile", "false");
144+
auto debugInDiscardFileBool = debugInDiscardFile == "true";
145+
ILOG_INST.filterDiscardSetFile(infologgerDiscardFile.c_str(), rotateMaxBytes, rotateMaxFiles, 0, !debugInDiscardFileBool /*Do not store Debug messages in file*/);
146+
147+
std::string id = "runQC";
148+
for (size_t i = 0; i < config.argc(); i++) {
149+
if (std::strcmp(config.argv()[i], "--id") == 0 && i + 1 < config.argc()) {
150+
id = config.argv()[i + 1];
151+
break;
152+
}
153+
}
154+
o2::quality_control::core::QcInfoLogger::setFacility(id);
155+
}
156+
129157
WorkflowSpec defineDataProcessing(const ConfigContext& config)
130158
{
131159
WorkflowSpec specs;
@@ -155,29 +183,7 @@ WorkflowSpec defineDataProcessing(const ConfigContext& config)
155183
// we set the infologger levels as soon as possible to avoid spamming
156184
auto configTree = ConfigurationFactory::getConfiguration(qcConfigurationSource)->getRecursive();
157185

158-
if (config.options().get<bool>("no-infologger")) {
159-
quality_control::core::QcInfoLogger::disable();
160-
} else {
161-
auto infologgerFilterDiscardDebug = configTree.get<bool>("qc.config.infologger.filterDiscardDebug", true);
162-
auto infologgerDiscardLevel = configTree.get<int>("qc.config.infologger.filterDiscardLevel", 21);
163-
ILOG_INST.filterDiscardDebug(infologgerFilterDiscardDebug);
164-
ILOG_INST.filterDiscardLevel(infologgerDiscardLevel);
165-
}
166-
auto infologgerDiscardFile = configTree.get<std::string>("qc.config.infologger.filterDiscardFile", "");
167-
auto rotateMaxBytes = configTree.get<u_long>("qc.config.infologger.filterRotateMaxBytes", 0);
168-
auto rotateMaxFiles = configTree.get<u_int>("qc.config.infologger.filterRotateMaxFiles", 0);
169-
std::string debugInDiscardFile = configTree.get<std::string>("qc.config.infologger.debugInDiscardFile", "false");
170-
auto debugInDiscardFileBool = debugInDiscardFile == "true";
171-
ILOG_INST.filterDiscardSetFile(infologgerDiscardFile.c_str(), rotateMaxBytes, rotateMaxFiles, 0, !debugInDiscardFileBool /*Do not store Debug messages in file*/);
172-
173-
std::string id = "runQC";
174-
for (size_t i = 0; i < config.argc(); i++) {
175-
if (std::strcmp(config.argv()[i], "--id") == 0 && i + 1 < config.argc()) {
176-
id = config.argv()[i + 1];
177-
break;
178-
}
179-
}
180-
o2::quality_control::core::QcInfoLogger::setFacility(id);
186+
setupInfologger(config, configTree);
181187

182188
ILOG(Info, Devel) << "Using config file '" << qcConfigurationSource << "'" << ENDM;
183189
auto keyValuesToOverride = quality_control::core::parseOverrideValues(config.options().get<std::string>("override-values"));

0 commit comments

Comments
 (0)