From 9af57a72a5804dcc7b91f55bdaccaf46cc1928aa Mon Sep 17 00:00:00 2001 From: David Rohr Date: Fri, 26 Nov 2021 10:05:53 +0100 Subject: [PATCH] Switch to lowercase log levels for new FairLogger (Framework) --- .../src/AODJAlienReaderHelpers.cxx | 6 +-- Framework/Core/COOKBOOK.md | 4 +- Framework/Core/README.md | 6 +-- .../Core/include/Framework/AnalysisTask.h | 2 +- .../include/Framework/HistogramRegistry.h | 8 ++-- .../Core/include/Framework/HistogramSpec.h | 2 +- Framework/Core/src/CommonDataProcessors.cxx | 2 +- .../Core/src/ComputingQuotaEvaluator.cxx | 4 +- Framework/Core/src/DPLWebSocket.cxx | 6 +-- Framework/Core/src/DataOutputDirector.cxx | 4 +- Framework/Core/src/DataProcessingDevice.cxx | 2 +- .../Core/src/ExternalFairMQDeviceProxy.cxx | 18 ++++----- Framework/Core/src/FreePortFinder.cxx | 4 +- Framework/Core/src/HistogramRegistry.cxx | 38 +++++++++---------- Framework/Core/src/HistogramSpec.cxx | 8 ++-- Framework/Core/src/LifetimeHelpers.cxx | 6 +-- Framework/Core/src/O2ControlHelpers.cxx | 22 +++++------ Framework/Core/src/Plugins.cxx | 6 +-- Framework/Core/src/StepTHn.cxx | 4 +- Framework/Core/src/TextDriverClient.cxx | 2 +- Framework/Core/src/WSDriverClient.cxx | 6 +-- Framework/Core/src/WorkflowHelpers.cxx | 10 ++--- Framework/Core/src/runDataProcessing.cxx | 12 +++--- .../benchmark_ExternalFairMQDeviceProxies.cxx | 2 +- Framework/Core/test/test_DataAllocator.cxx | 2 +- .../test_ExternalFairMQDeviceWorkflow.cxx | 2 +- Framework/Core/test/test_ParallelPipeline.cxx | 2 +- Framework/Core/test/test_ProcessorOptions.cxx | 2 +- .../Core/test/test_StaggeringWorkflow.cxx | 2 +- Framework/Core/test/test_Task.cxx | 2 +- .../test_VariablePayloadSequenceWorkflow.cxx | 6 +-- .../TestWorkflows/src/o2DiamondWorkflow.cxx | 8 ++-- .../TestWorkflows/src/o2DummyWorkflow.cxx | 2 +- .../src/test_o2RootMessageWorkflow.cxx | 6 +-- .../include/DPLUtils/MakeRootTreeWriterSpec.h | 2 +- .../Utils/include/DPLUtils/RootTreeReader.h | 6 +-- .../Utils/include/DPLUtils/RootTreeWriter.h | 4 +- Framework/Utils/src/raw-parser.cxx | 4 +- Framework/Utils/test/DPLBroadcasterMerger.cxx | 20 +++++----- Framework/Utils/test/DPLOutputTest.cxx | 20 +++++----- .../Utils/test/test_DPLRawPageSequencer.cxx | 4 +- Framework/Utils/test/test_DPLRawParser.cxx | 6 +-- Framework/Utils/test/test_RootTreeReader.cxx | 8 ++-- 43 files changed, 146 insertions(+), 146 deletions(-) diff --git a/Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx b/Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx index 66cc796249429..4d8d3eaf93585 100644 --- a/Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx +++ b/Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx @@ -163,7 +163,7 @@ AlgorithmSpec AODJAlienReaderHelpers::rootFileReaderCallback() monitoring.flushBuffer(); if (!options.isSet("aod-file")) { - LOGP(FATAL, "No input file defined!"); + LOGP(fatal, "No input file defined!"); throw std::runtime_error("Processing is stopped!"); } @@ -272,11 +272,11 @@ AlgorithmSpec AODJAlienReaderHelpers::rootFileReaderCallback() ntf = 0; tr = didir->getDataTree(dh, fcnt, ntf); if (!tr) { - LOGP(FATAL, "Can not retrieve tree for table {}: fileCounter {}, timeFrame {}", concrete.origin, fcnt, ntf); + LOGP(fatal, "Can not retrieve tree for table {}: fileCounter {}, timeFrame {}", concrete.origin, fcnt, ntf); throw std::runtime_error("Processing is stopped!"); } } else { - LOGP(FATAL, "Can not retrieve tree for table {}: fileCounter {}, timeFrame {}", concrete.origin, fcnt, ntf); + LOGP(fatal, "Can not retrieve tree for table {}: fileCounter {}, timeFrame {}", concrete.origin, fcnt, ntf); throw std::runtime_error("Processing is stopped!"); } } diff --git a/Framework/Core/COOKBOOK.md b/Framework/Core/COOKBOOK.md index 91a65b4d2700f..fe020364b6228 100644 --- a/Framework/Core/COOKBOOK.md +++ b/Framework/Core/COOKBOOK.md @@ -28,7 +28,7 @@ for (const auto& element : data) { #### How do I report failure for a given Algorithm? -Whenever the driver process spots an error message, i.e. an error printed via `LOG(ERROR)` facility, when the driver process quits, it will exit with a exit code of 1. This includes any exception reported by the default exception handler. +Whenever the driver process spots an error message, i.e. an error printed via `LOG(error)` facility, when the driver process quits, it will exit with a exit code of 1. This includes any exception reported by the default exception handler. This comes handy, for example in tests. @@ -328,7 +328,7 @@ DataProcessorSpec{ AlgorithmSpec{[](InitContext &setup) { return [](ProcessingContext &ctx) { // Create a single output. - LOG(DEBUG) << "Invoked" << std::endl; + LOG(debug) << "Invoked" << std::endl; }; } // ... diff --git a/Framework/Core/README.md b/Framework/Core/README.md index 644b3b2e79dae..d27e7f877b32c 100644 --- a/Framework/Core/README.md +++ b/Framework/Core/README.md @@ -335,9 +335,9 @@ FairLogger. #include "Framework/Logger.h" ... -LOG(INFO) << "some message"; // streamer based API -LOGF(INFO, "%s", "some message"); // printf based API -LOGP(INFO, "{}", "some message"); // python / fmt based API +LOG(info) << "some message"; // streamer based API +LOGF(info, "%s", "some message"); // printf based API +LOGP(info, "{}", "some message"); // python / fmt based API O2INFO("{}", "some message); // same but with less typing. ``` diff --git a/Framework/Core/include/Framework/AnalysisTask.h b/Framework/Core/include/Framework/AnalysisTask.h index 0f541425efa1c..d2cd1ac13ff22 100644 --- a/Framework/Core/include/Framework/AnalysisTask.h +++ b/Framework/Core/include/Framework/AnalysisTask.h @@ -874,7 +874,7 @@ DataProcessorSpec adaptAnalysisTask(ConfigContext const& ctx, Args&&... args) // no static way to check if the task defines any processing, we can only make sure it subscribes to at least something if (inputs.empty() == true) { - LOG(WARN) << "Task " << name_str << " has no inputs"; + LOG(warn) << "Task " << name_str << " has no inputs"; } homogeneous_apply_refs([&outputs, &hash](auto& x) { return OutputManager>::appendOutput(outputs, x, hash); }, *task.get()); diff --git a/Framework/Core/include/Framework/HistogramRegistry.h b/Framework/Core/include/Framework/HistogramRegistry.h index 4f9b151bc8ac3..6760abf836285 100644 --- a/Framework/Core/include/Framework/HistogramRegistry.h +++ b/Framework/Core/include/Framework/HistogramRegistry.h @@ -218,11 +218,11 @@ void HistFiller::fillHistAny(std::shared_ptr hist, const Ts&... positionAndWe if (hist->GetNdimensions() == nArgsMinusOne) { weight = tempArray[nArgsMinusOne]; } else if (hist->GetNdimensions() != nArgs) { - LOGF(FATAL, "The number of arguments in fill function called for histogram %s is incompatible with histogram dimensions.", hist->GetName()); + LOGF(fatal, "The number of arguments in fill function called for histogram %s is incompatible with histogram dimensions.", hist->GetName()); } hist->Fill(tempArray, weight); } else { - LOGF(FATAL, "The number of arguments in fill function called for histogram %s is incompatible with histogram dimensions.", hist->GetName()); + LOGF(fatal, "The number of arguments in fill function called for histogram %s is incompatible with histogram dimensions.", hist->GetName()); } } @@ -230,7 +230,7 @@ template void HistFiller::fillHistAny(std::shared_ptr hist, const T& table, const o2::framework::expressions::Filter& filter) { if constexpr (std::is_base_of_v) { - LOGF(FATAL, "Table filling is not (yet?) supported for StepTHn."); + LOGF(fatal, "Table filling is not (yet?) supported for StepTHn."); return; } auto filtered = o2::soa::Filtered{{table.asArrowTable()}, o2::framework::expressions::createSelection(table.asArrowTable(), filter)}; @@ -386,7 +386,7 @@ HistPtr HistogramRegistry::insertClone(const HistName& histName, const std::shar return mRegistryValue[imask(histName.idx + i)]; } } - LOGF(FATAL, R"(Internal array of HistogramRegistry "%s" is full.)", mName); + LOGF(fatal, R"(Internal array of HistogramRegistry "%s" is full.)", mName); return HistPtr(); } diff --git a/Framework/Core/include/Framework/HistogramSpec.h b/Framework/Core/include/Framework/HistogramSpec.h index f6cb365d78301..eb3c4badf5d78 100644 --- a/Framework/Core/include/Framework/HistogramSpec.h +++ b/Framework/Core/include/Framework/HistogramSpec.h @@ -95,7 +95,7 @@ struct AxisSpec { name(name_) { if (binMin_ > binMax_) { - LOG(FATAL) << "Defined ill-defined axis"; + LOG(fatal) << "Defined ill-defined axis"; } } diff --git a/Framework/Core/src/CommonDataProcessors.cxx b/Framework/Core/src/CommonDataProcessors.cxx index a037d48f56c49..f832750b81770 100644 --- a/Framework/Core/src/CommonDataProcessors.cxx +++ b/Framework/Core/src/CommonDataProcessors.cxx @@ -341,7 +341,7 @@ DataProcessorSpec if (it != tfNumbers.end()) { tfNumber = (it->second / dod->getNumberTimeFramesToMerge()) * dod->getNumberTimeFramesToMerge(); } else { - LOGP(FATAL, "No time frame number found for output with start time {}", startTime); + LOGP(fatal, "No time frame number found for output with start time {}", startTime); throw std::runtime_error("Processing is stopped!"); } diff --git a/Framework/Core/src/ComputingQuotaEvaluator.cxx b/Framework/Core/src/ComputingQuotaEvaluator.cxx index 1ab381ade3339..ef9d4a072a8c6 100644 --- a/Framework/Core/src/ComputingQuotaEvaluator.cxx +++ b/Framework/Core/src/ComputingQuotaEvaluator.cxx @@ -75,14 +75,14 @@ bool ComputingQuotaEvaluator::selectOffer(int task, ComputingQuotaRequest const& auto summarizeWhatHappended = [](bool enough, std::vector const& result, ComputingQuotaOffer const& totalOffer, QuotaEvaluatorStats& stats) -> bool { if (result.size() == 1 && result[0] == 0) { - // LOG(INFO) << "No particular resource was requested, so we schedule task anyways"; + // LOG(info) << "No particular resource was requested, so we schedule task anyways"; return enough; } if (enough) { LOGP(info, "{} offers were selected for a total of: cpu {}, memory {}, shared memory {}", result.size(), totalOffer.cpu, totalOffer.memory, totalOffer.sharedMemory); LOGP(info, " The following offers were selected for computation: {} ", fmt::join(result, ",")); } else { - LOG(INFO) << "No offer was selected"; + LOG(info) << "No offer was selected"; if (result.size()) { LOGP(info, " The following offers were selected for computation but not enough: {} ", fmt::join(result, ",")); } diff --git a/Framework/Core/src/DPLWebSocket.cxx b/Framework/Core/src/DPLWebSocket.cxx index 80bd2e0daae32..b4482eaa8c2ee 100644 --- a/Framework/Core/src/DPLWebSocket.cxx +++ b/Framework/Core/src/DPLWebSocket.cxx @@ -287,7 +287,7 @@ void WSDPLHandler::endHeaders() } } } else { - LOG(INFO) << "Connection not bound to a PID"; + LOG(info) << "Connection not bound to a PID"; } } @@ -440,7 +440,7 @@ void WSDPLClient::header(std::string_view const& k, std::string_view const& v) void WSDPLClient::dumpHeaders() { for (auto [k, v] : mHeaders) { - LOG(INFO) << k << ": " << v; + LOG(info) << k << ": " << v; } } @@ -463,7 +463,7 @@ void WSDPLClient::endHeaders() throw runtime_error_f(R"(Invalid accept received: "%s", expected "%s")", mHeaders["sec-websocket-accept"].c_str(), expectedAccept.c_str()); } - LOG(INFO) << "Correctly handshaken websocket connection."; + LOG(info) << "Correctly handshaken websocket connection."; /// Create an appropriate reply mHandshaken = true; mHandshake(); diff --git a/Framework/Core/src/DataOutputDirector.cxx b/Framework/Core/src/DataOutputDirector.cxx index 662178f6f4cf1..2ca9968fb822b 100644 --- a/Framework/Core/src/DataOutputDirector.cxx +++ b/Framework/Core/src/DataOutputDirector.cxx @@ -176,7 +176,7 @@ void DataOutputDirector::readString(std::string const& keepString) auto it = std::unique(mtreeFilenames.begin(), mtreeFilenames.end()); if (it != mtreeFilenames.end()) { printOut(); - LOGP(FATAL, "Dublicate tree names in a file!"); + LOGP(fatal, "Dublicate tree names in a file!"); } // make unique/sorted list of filenameBases @@ -503,7 +503,7 @@ void DataOutputDirector::setFilenameBase(std::string dfn) auto it = std::unique(mtreeFilenames.begin(), mtreeFilenames.end()); if (it != mtreeFilenames.end()) { printOut(); - LOG(FATAL) << "Duplicate tree names in a file!"; + LOG(fatal) << "Duplicate tree names in a file!"; } // make unique/sorted list of filenameBases diff --git a/Framework/Core/src/DataProcessingDevice.cxx b/Framework/Core/src/DataProcessingDevice.cxx index e728ebf9afb57..78ad5429e8cea 100644 --- a/Framework/Core/src/DataProcessingDevice.cxx +++ b/Framework/Core/src/DataProcessingDevice.cxx @@ -1024,7 +1024,7 @@ void DataProcessingDevice::handleData(DataProcessorContext& context, InputChanne switch (relayed) { case DataRelayer::Backpressured: if (info.normalOpsNotified == true && info.backpressureNotified == false) { - LOGP(WARN, "Backpressure on channel {}. Waiting.", info.channel->GetName()); + LOGP(warn, "Backpressure on channel {}. Waiting.", info.channel->GetName()); info.backpressureNotified = true; info.normalOpsNotified = false; } diff --git a/Framework/Core/src/ExternalFairMQDeviceProxy.cxx b/Framework/Core/src/ExternalFairMQDeviceProxy.cxx index c0175f322c2ac..09a52dd9a73b7 100644 --- a/Framework/Core/src/ExternalFairMQDeviceProxy.cxx +++ b/Framework/Core/src/ExternalFairMQDeviceProxy.cxx @@ -100,7 +100,7 @@ void sendOnChannel(FairMQDevice& device, FairMQParts& messages, std::string cons } // FIXME: we need a better logic for avoiding message spam if (timeout > 1 && timeout <= maxTimeout) { - LOG(WARNING) << "dispatching on channel " << channel << " was delayed by " << timeout << " ms"; + LOG(warning) << "dispatching on channel " << channel << " was delayed by " << timeout << " ms"; } // TODO: feeling this is a bit awkward, but the interface of FairMQParts does not provide a // method to clear the content. @@ -116,7 +116,7 @@ void sendOnChannel(FairMQDevice& device, FairMQParts& messages, OutputSpec const // array of channels, the index is 0 in the call auto channel = channelRetriever(spec, tslice); if (channel.empty()) { - LOG(WARNING) << "can not find matching channel for " << DataSpecUtils::describe(spec) << " timeslice " << tslice; + LOG(warning) << "can not find matching channel for " << DataSpecUtils::describe(spec) << " timeslice " << tslice; return; } sendOnChannel(device, messages, channel); @@ -132,7 +132,7 @@ void sendOnChannel(FairMQDevice& device, o2::header::Stack&& headerStack, FairMQ auto channelName = channelRetriever(spec, dph->startTime); constexpr auto index = 0; if (channelName.empty()) { - LOG(WARNING) << "can not find matching channel for " << DataSpecUtils::describe(spec); + LOG(warning) << "can not find matching channel for " << DataSpecUtils::describe(spec); return; } for (auto& channelInfo : device.fChannels) { @@ -209,7 +209,7 @@ InjectorFunction dplModelAdaptor(std::vector const& filterSpecs, boo void warning() const { if (not descriptions.empty()) { - LOG(WARNING) << "Some input data are not matched by filter rules " << descriptions << "\n" + LOG(warning) << "Some input data are not matched by filter rules " << descriptions << "\n" << "DROPPING OF THESE MESSAGES HAS BEEN ENABLED BY CONFIGURATION"; } } @@ -248,16 +248,16 @@ InjectorFunction dplModelAdaptor(std::vector const& filterSpecs, boo DataSpecUtils::match(spec, query)) { auto channelName = channelRetriever(query, dph->startTime); if (channelName.empty()) { - LOG(WARNING) << "can not find matching channel, not able to adopt " << DataSpecUtils::describe(query); + LOG(warning) << "can not find matching channel, not able to adopt " << DataSpecUtils::describe(query); break; } // the checks for consistency of split payload parts are of informative nature // forwarding happens independently if (dh->splitPayloadParts > 1 && dh->splitPayloadParts != std::numeric_limitssplitPayloadParts)>::max()) { if (lastSplitPartIndex == -1 && dh->splitPayloadIndex != 0) { - LOG(WARNING) << "wrong split part index, expecting the first of " << dh->splitPayloadParts << " part(s)"; + LOG(warning) << "wrong split part index, expecting the first of " << dh->splitPayloadParts << " part(s)"; } else if (dh->splitPayloadIndex != lastSplitPartIndex + 1) { - LOG(WARNING) << "unordered split parts, expecting part " << lastSplitPartIndex + 1 << ", got " << dh->splitPayloadIndex + LOG(warning) << "unordered split parts, expecting part " << lastSplitPartIndex + 1 << ", got " << dh->splitPayloadIndex << " of " << dh->splitPayloadParts; } else if (channelNameForSplitParts.empty() == false && channelName != channelNameForSplitParts) { LOG(error) << "inconsistent channel for split part " << dh->splitPayloadIndex @@ -270,7 +270,7 @@ InjectorFunction dplModelAdaptor(std::vector const& filterSpecs, boo channelNameForSplitParts = ""; } } else if (lastSplitPartIndex != -1) { - LOG(WARNING) << "found incomplete or unordered split parts, expecting part " << lastSplitPartIndex + 1 + LOG(warning) << "found incomplete or unordered split parts, expecting part " << lastSplitPartIndex + 1 << " but got a new data block"; } outputs[channelName].AddPart(std::move(parts.At(msgidx * 2))); @@ -465,7 +465,7 @@ DataProcessorSpec specifyFairMQDeviceOutputProxy(char const* name, // FairMQDevice calls the custom init before the channels have been configured // so we do the check before starting in a dedicated callback auto channelConfigurationChecker = [inputSpecs = std::move(inputSpecs), device, outputChannelName]() { - LOG(INFO) << "checking channel configuration"; + LOG(info) << "checking channel configuration"; if (device->fChannels.count(outputChannelName) == 0) { throw std::runtime_error("no corresponding output channel found for input '" + outputChannelName + "'"); } diff --git a/Framework/Core/src/FreePortFinder.cxx b/Framework/Core/src/FreePortFinder.cxx index b869c3b2e8005..e2f3b4e026ad6 100644 --- a/Framework/Core/src/FreePortFinder.cxx +++ b/Framework/Core/src/FreePortFinder.cxx @@ -44,13 +44,13 @@ void FreePortFinder::scan() for (mPort = mInitialPort; mPort < mFinalPort; mPort += mStep) { if (!testPort(mPort)) { if (mVerbose) { - LOG(WARN) << "Port range [" << mPort << ", " << mPort + mStep + LOG(warn) << "Port range [" << mPort << ", " << mPort + mStep << "] already taken. Skipping"; } continue; } if (mVerbose) { - LOG(INFO) << "Using port range [" << mPort << ", " << mPort + mStep << "]"; + LOG(info) << "Using port range [" << mPort << ", " << mPort + mStep << "]"; } break; } diff --git a/Framework/Core/src/HistogramRegistry.cxx b/Framework/Core/src/HistogramRegistry.cxx index 127c82ac2cac9..668defa959293 100644 --- a/Framework/Core/src/HistogramRegistry.cxx +++ b/Framework/Core/src/HistogramRegistry.cxx @@ -72,7 +72,7 @@ HistPtr HistogramRegistry::insert(const HistogramSpec& histSpec) return mRegistryValue[imask(idx + i)]; } } - LOGF(FATAL, R"(Internal array of HistogramRegistry "%s" is full.)", mName); + LOGF(fatal, R"(Internal array of HistogramRegistry "%s" is full.)", mName); return HistPtr(); } @@ -85,12 +85,12 @@ void HistogramRegistry::validateHistName(const std::string& name, const uint32_t auto idx = it - mRegistryKey.begin(); std::string collidingName{}; std::visit([&](const auto& hist) { collidingName = hist->GetName(); }, mRegistryValue[idx]); - LOGF(FATAL, R"(Hash collision in HistogramRegistry "%s"! Please rename histogram "%s" or "%s".)", mName, name, collidingName); + LOGF(fatal, R"(Hash collision in HistogramRegistry "%s"! Please rename histogram "%s" or "%s".)", mName, name, collidingName); } // validate that name contains only allowed characters if (!std::regex_match(name, std::regex("([a-zA-Z0-9])(([\\/_])?[a-zA-Z0-9])*"))) { - LOGF(FATAL, R"(Histogram name "%s" contains invalid characters.)", name); + LOGF(fatal, R"(Histogram name "%s" contains invalid characters.)", name); } } @@ -125,7 +125,7 @@ void HistogramRegistry::addClone(const std::string& source, const std::string& t } // when cloning a single histogram the specified target_ must not be a group name if (sourceName.size() == source.size() && target.back() == '/') { - LOGF(FATAL, "Cannot turn histogram into folder!"); + LOGF(fatal, "Cannot turn histogram into folder!"); } std::string targetName{target}; targetName += sourceName.substr(sourceName.find(source) + source.size()); @@ -205,7 +205,7 @@ void HistogramRegistry::print(bool showAxisDetails) sizeInfo = fmt::format("{:.2f} kB", sizes[0] * 1024); } std::transform(totalSizes.begin(), totalSizes.end(), sizes.begin(), totalSizes.begin(), std::plus()); - LOGF(INFO, "Hist %03d: %-35s %-19s [%s]", nHistos, hist->GetName(), hist->IsA()->GetName(), sizeInfo); + LOGF(info, "Hist %03d: %-35s %-19s [%s]", nHistos, hist->GetName(), hist->IsA()->GetName(), sizeInfo); if (showAxisDetails) { int nDim = 0; @@ -227,16 +227,16 @@ void HistogramRegistry::print(bool showAxisDetails) axis = hist->GetZaxis(); } } - LOGF(INFO, "- Axis %d: %-20s (%d bins)", d, axis->GetTitle(), axis->GetNbins()); + LOGF(info, "- Axis %d: %-20s (%d bins)", d, axis->GetTitle(), axis->GetNbins()); } } } }; std::string titleString{"======================== HistogramRegistry ========================"}; - LOGF(INFO, ""); - LOGF(INFO, "%s", titleString); - LOGF(INFO, "%s\"%s\"", std::string((int)(0.5 * titleString.size() - (1 + 0.5 * mName.size())), ' '), mName); + LOGF(info, ""); + LOGF(info, "%s", titleString); + LOGF(info, "%s\"%s\"", std::string((int)(0.5 * titleString.size() - (1 + 0.5 * mName.size())), ' '), mName); for (auto& curHistName : mRegisteredNames) { std::visit(printHistInfo, mRegistryValue[getHistIndex(HistName{curHistName.data()})]); } @@ -251,13 +251,13 @@ void HistogramRegistry::print(bool showAxisDetails) } else { totalSizeInfo = fmt::format("{:.2f} MB", totalSizes[0]); } - LOGF(INFO, "%s", std::string(titleString.size(), '='), titleString); - LOGF(INFO, "Total: %d histograms, ca. %s", nHistos, totalSizeInfo); + LOGF(info, "%s", std::string(titleString.size(), '='), titleString); + LOGF(info, "Total: %d histograms, ca. %s", nHistos, totalSizeInfo); if (lookup) { - LOGF(INFO, "Due to index collisions, histograms were shifted by %d registry slots in total.", lookup); + LOGF(info, "Due to index collisions, histograms were shifted by %d registry slots in total.", lookup); } - LOGF(INFO, "%s", std::string(titleString.size(), '='), titleString); - LOGF(INFO, ""); + LOGF(info, "%s", std::string(titleString.size(), '='), titleString); + LOGF(info, ""); } // create output structure will be propagated to file-sink @@ -286,7 +286,7 @@ TList* HistogramRegistry::operator*() rawPtr->SetName(name.data()); targetList->Add(rawPtr); } else { - LOGF(FATAL, "Specified subfolder could not be created."); + LOGF(fatal, "Specified subfolder could not be created."); } } } @@ -359,25 +359,25 @@ std::deque HistogramRegistry::splitPath(const std::string& pathAndN void HistogramRegistry::registerName(const std::string& name) { if (name.empty() || name.back() == '/') { - LOGF(FATAL, "Invalid name for a histogram."); + LOGF(fatal, "Invalid name for a histogram."); } std::deque path = splitPath(name); std::string cumulativeName{}; int depth = path.size(); for (auto& step : path) { if (step.empty()) { - LOGF(FATAL, R"(Found empty group name in path for histogram "%s".)", name); + LOGF(fatal, R"(Found empty group name in path for histogram "%s".)", name); } cumulativeName += step; for (auto& curName : mRegisteredNames) { // there is already a histogram where we want to put a folder or histogram if (cumulativeName == curName) { - LOGF(FATAL, R"(Histogram name "%s" is not compatible with existing names.)", name); + LOGF(fatal, R"(Histogram name "%s" is not compatible with existing names.)", name); } // for the full new histogram name we need to check that none of the existing histograms already uses this as a group name if (depth == 1) { if (curName.rfind(cumulativeName, 0) == 0 && curName.size() > cumulativeName.size() && curName.at(cumulativeName.size()) == '/') { - LOGF(FATAL, R"(Histogram name "%s" is not compatible with existing names.)", name); + LOGF(fatal, R"(Histogram name "%s" is not compatible with existing names.)", name); } } } diff --git a/Framework/Core/src/HistogramSpec.cxx b/Framework/Core/src/HistogramSpec.cxx index 20aeeb19857f9..719546420e11f 100644 --- a/Framework/Core/src/HistogramSpec.cxx +++ b/Framework/Core/src/HistogramSpec.cxx @@ -18,7 +18,7 @@ namespace o2::framework void AxisSpec::makeLogaritmic() { if (binEdges.size() > 2) { - LOG(FATAL) << "Cannot make a variabled bin width axis logaritmic"; + LOG(fatal) << "Cannot make a variabled bin width axis logaritmic"; } const double min = binEdges[0]; @@ -45,7 +45,7 @@ std::unique_ptr HistFactory::createHist(const HistogramSpec& histSpec) constexpr std::size_t MAX_DIM{10}; const std::size_t nAxes{histSpec.config.axes.size()}; if (nAxes == 0 || nAxes > MAX_DIM) { - LOGF(FATAL, "The histogram specification contains no (or too many) axes."); + LOGF(fatal, "The histogram specification contains no (or too many) axes."); return nullptr; } @@ -63,7 +63,7 @@ std::unique_ptr HistFactory::createHist(const HistogramSpec& histSpec) // create histogram std::unique_ptr hist{generateHist(histSpec.name, histSpec.title, nAxes, nBins, lowerBounds, upperBounds, histSpec.config.nSteps)}; if (!hist) { - LOGF(FATAL, "The number of dimensions specified for histogram %s does not match the type.", histSpec.name); + LOGF(fatal, "The number of dimensions specified for histogram %s does not match the type.", histSpec.name); return nullptr; } @@ -85,7 +85,7 @@ std::unique_ptr HistFactory::createHist(const HistogramSpec& histSpec) // move the bin edges in case a variable binning was requested if (!histSpec.config.axes[i].nBins) { if (!std::is_sorted(std::begin(histSpec.config.axes[i].binEdges), std::end(histSpec.config.axes[i].binEdges))) { - LOGF(FATAL, "The bin edges in histogram %s are not in increasing order!", histSpec.name); + LOGF(fatal, "The bin edges in histogram %s are not in increasing order!", histSpec.name); return nullptr; } axis->Set(nBins[i], histSpec.config.axes[i].binEdges.data()); diff --git a/Framework/Core/src/LifetimeHelpers.cxx b/Framework/Core/src/LifetimeHelpers.cxx index c55fa4d92a0a7..4adff931f2176 100644 --- a/Framework/Core/src/LifetimeHelpers.cxx +++ b/Framework/Core/src/LifetimeHelpers.cxx @@ -204,7 +204,7 @@ ExpirationHandler::Checker if (waitForCTP == false || dataTakingContext.source == OrbitResetTimeSource::CTP) { return true; } - LOG(INFO) << "CTP is not there, fetching."; + LOG(info) << "CTP is not there, fetching."; std::vector buffer; CURL* curl = curl_easy_init(); if (curl == nullptr) { @@ -213,7 +213,7 @@ ExpirationHandler::Checker CURLcode res; std::string path = "CTP/Calib/OrbitReset"; auto url = fmt::format("{}/{}/{}", serverUrl, path, timestamp / 1000); - LOG(INFO) << "Fetching CTP from " << url; + LOG(info) << "Fetching CTP from " << url; curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer); @@ -247,7 +247,7 @@ ExpirationHandler::Checker } memFile.Close(); std::vector* ctp = (std::vector*)result; - LOG(INFO) << "Orbit reset time now at " << (*ctp)[0]; + LOG(info) << "Orbit reset time now at " << (*ctp)[0]; dataTakingContext.orbitResetTime = (*ctp)[0]; dataTakingContext.source = OrbitResetTimeSource::CTP; return true; diff --git a/Framework/Core/src/O2ControlHelpers.cxx b/Framework/Core/src/O2ControlHelpers.cxx index 78eb97d8b0045..06e00cb84d3d7 100644 --- a/Framework/Core/src/O2ControlHelpers.cxx +++ b/Framework/Core/src/O2ControlHelpers.cxx @@ -81,12 +81,12 @@ void dumpRawChannelConnect(std::ostream& dumpOut, const RawChannel& channel, boo dumpOut << indLevel << indScheme << "transport: " << channel.transport << "\n"; if (preserveRawChannels) { dumpOut << indLevel << indScheme << "target: \"" << channel.address << "\"\n"; - LOG(INFO) << "This topology will connect to the channel '" << channel.name << "', which is most likely bound outside." + LOG(info) << "This topology will connect to the channel '" << channel.name << "', which is most likely bound outside." << " Please make sure it is available under the address '" << channel.address << "' in the mother workflow or another subworkflow."; } else { auto channelRef = rawChannelReference(channel.name, isUniqueChannel); - LOG(INFO) << "This topology will connect to the channel '" << channel.name << "', which is most likely bound outside." + LOG(info) << "This topology will connect to the channel '" << channel.name << "', which is most likely bound outside." << " Please make sure it is declared in the global channel space under the name '" << channelRef << "' in the mother workflow or another subworkflow."; dumpOut << indLevel << indScheme << "target: \"::" << channelRef << "\"\n"; @@ -102,14 +102,14 @@ void dumpRawChannelBind(std::ostream& dumpOut, const RawChannel& channel, bool i dumpOut << indLevel << indScheme << "addressing: " << (channel.address.find("ipc") != std::string_view::npos ? "ipc" : "tcp") << "\n"; dumpOut << indLevel << indScheme << "rateLogging: \"{{ fmq_rate_logging }}\"\n"; if (preserveRawChannels) { - LOG(INFO) << "This topology will bind a dangling channel '" << channel.name << "'" + LOG(info) << "This topology will bind a dangling channel '" << channel.name << "'" << " with the address '" << channel.address << "'." << " Please make sure that another device connects to this channel elsewhere." << " Also, don't mind seeing the message twice, it will be addressed in future releases."; dumpOut << indLevel << indScheme << "target: \"" << channel.address << "\"\n"; } else { auto channelRef = rawChannelReference(channel.name, isUniqueChannel); - LOG(INFO) << "This topology will bind a dangling channel '" << channel.name << "'" + LOG(info) << "This topology will bind a dangling channel '" << channel.name << "'" << " and declare it in the global channel space under the name '" << channelRef << "'." << " Please make sure that another device connects to this channel elsewhere." << " Also, don't mind seeing the message twice, it will be addressed in future releases."; @@ -316,7 +316,7 @@ void dumpTask(std::ostream& dumpOut, const DeviceSpec& spec, const DeviceExecuti dumpOut << indLevel << indScheme << "log_task_output: none\n"; if (bfs::path(execution.args[0]).filename().string() != execution.args[0]) { - LOG(WARNING) << "The workflow template generation was started with absolute or relative executables paths." + LOG(warning) << "The workflow template generation was started with absolute or relative executables paths." " Please use the symlinks exported by the build infrastructure or remove the paths manually in the generated templates," " unless you really need executables within concrete directories"; } @@ -390,16 +390,16 @@ void dumpDeviceSpec2O2Control(std::string workflowName, const char* tasksDirectory = "tasks"; const char* workflowsDirectory = "workflows"; - LOG(INFO) << "Dumping the workflow configuration for AliECS."; + LOG(info) << "Dumping the workflow configuration for AliECS."; - LOG(INFO) << "Creating directories '" << workflowsDirectory << "' and '" << tasksDirectory << "'."; + LOG(info) << "Creating directories '" << workflowsDirectory << "' and '" << tasksDirectory << "'."; std::filesystem::create_directory(workflowsDirectory); std::filesystem::create_directory(tasksDirectory); - LOG(INFO) << "... created."; + LOG(info) << "... created."; assert(specs.size() == executions.size()); - LOG(INFO) << "Creating a workflow dump '" + workflowName + "'."; + LOG(info) << "Creating a workflow dump '" + workflowName + "'."; std::string wfDumpPath = std::string(workflowsDirectory) + bfs::path::preferred_separator + workflowName + ".yaml"; std::ofstream wfDump(wfDumpPath); dumpWorkflow(wfDump, specs, executions, commandInfo, workflowName, ""); @@ -409,13 +409,13 @@ void dumpDeviceSpec2O2Control(std::string workflowName, auto& spec = specs[di]; auto& execution = executions[di]; - LOG(INFO) << "Creating a task dump for '" + spec.id + "'."; + LOG(info) << "Creating a task dump for '" + spec.id + "'."; std::string taskName = implementation::taskName(workflowName, spec.id); std::string taskDumpPath = std::string(tasksDirectory) + bfs::path::preferred_separator + taskName + ".yaml"; std::ofstream taskDump(taskDumpPath); dumpTask(taskDump, spec, execution, taskName, ""); taskDump.close(); - LOG(INFO) << "...created."; + LOG(info) << "...created."; } } diff --git a/Framework/Core/src/Plugins.cxx b/Framework/Core/src/Plugins.cxx index 614f67add02cb..c3a7005c489ac 100644 --- a/Framework/Core/src/Plugins.cxx +++ b/Framework/Core/src/Plugins.cxx @@ -33,7 +33,7 @@ void PluginManager::load(std::vector& libs, const char* dso, std::fu std::string filename = fmt::format("lib{}.{}", dso, extension); result = uv_dlopen(filename.c_str(), supportLib); if (result == -1) { - LOG(FATAL) << uv_dlerror(supportLib); + LOG(fatal) << uv_dlerror(supportLib); return; } void* callback = nullptr; @@ -41,11 +41,11 @@ void PluginManager::load(std::vector& libs, const char* dso, std::fu result = uv_dlsym(supportLib, "dpl_plugin_callback", (void**)&dpl_plugin_callback); if (result == -1) { - LOG(FATAL) << uv_dlerror(supportLib); + LOG(fatal) << uv_dlerror(supportLib); return; } if (dpl_plugin_callback == nullptr) { - LOGP(FATAL, "Could not find the {} plugin.", dso); + LOGP(fatal, "Could not find the {} plugin.", dso); return; } DPLPluginHandle* pluginInstance = dpl_plugin_callback(nullptr); diff --git a/Framework/Core/src/StepTHn.cxx b/Framework/Core/src/StepTHn.cxx index abc7a37e68bcc..85543f41bd3fc 100644 --- a/Framework/Core/src/StepTHn.cxx +++ b/Framework/Core/src/StepTHn.cxx @@ -373,14 +373,14 @@ void StepTHn::createTarget(Int_t step, Bool_t sparse) void StepTHn::Fill(int iStep, int nParams, double positionAndWeight[]) { if (iStep >= mNSteps) { - LOGF(FATAL, "Selected step for filling is not in range of StepTHn."); + LOGF(fatal, "Selected step for filling is not in range of StepTHn."); } double weight = 1.0; if (nParams == mNVars + 1) { weight = positionAndWeight[mNVars]; } else if (nParams != mNVars) { - LOGF(FATAL, "Fill called with invalid number of parameters (%d vs %d)", mNVars, nParams); + LOGF(fatal, "Fill called with invalid number of parameters (%d vs %d)", mNVars, nParams); } // fill axis cache diff --git a/Framework/Core/src/TextDriverClient.cxx b/Framework/Core/src/TextDriverClient.cxx index 185db847abb44..9c7f9ee049fe1 100644 --- a/Framework/Core/src/TextDriverClient.cxx +++ b/Framework/Core/src/TextDriverClient.cxx @@ -20,7 +20,7 @@ TextDriverClient::TextDriverClient(ServiceRegistry& registry, DeviceState& devic void TextDriverClient::tell(const char* msg, size_t s, bool flush) { - LOG(INFO) << std::string_view{msg, s}; + LOG(info) << std::string_view{msg, s}; } void TextDriverClient::flushPending() diff --git a/Framework/Core/src/WSDriverClient.cxx b/Framework/Core/src/WSDriverClient.cxx index 52656c482fb4e..f27108460950a 100644 --- a/Framework/Core/src/WSDriverClient.cxx +++ b/Framework/Core/src/WSDriverClient.cxx @@ -83,7 +83,7 @@ void on_connect(uv_connect_t* connection, int status) std::lock_guard lock(client->mutex()); auto handler = std::make_unique(*client); client->observe("/ping", [](std::string_view) { - LOG(INFO) << "ping"; + LOG(info) << "ping"; }); /// FIXME: for now we simply take any offer as 1GB of SHM available client->observe("/shm-offer", [state = context->state](std::string_view cmd) { @@ -199,7 +199,7 @@ void WSDriverClient::flushPending() if (!mClient) { if (mBacklog.size() > 2000) { if (!printed1) { - LOG(WARNING) << "Unable to communicate with driver because client does not exist. Continuing connection attempts."; + LOG(warning) << "Unable to communicate with driver because client does not exist. Continuing connection attempts."; printed1 = true; } } @@ -208,7 +208,7 @@ void WSDriverClient::flushPending() if (!(mClient->isHandshaken())) { if (mBacklog.size() > 2000) { if (!printed2) { - LOG(WARNING) << "Unable to communicate with driver because client is not connected. Continuing connection attempts."; + LOG(warning) << "Unable to communicate with driver because client is not connected. Continuing connection attempts."; printed2 = true; } } diff --git a/Framework/Core/src/WorkflowHelpers.cxx b/Framework/Core/src/WorkflowHelpers.cxx index e0855df75d2b1..377400df77c0f 100644 --- a/Framework/Core/src/WorkflowHelpers.cxx +++ b/Framework/Core/src/WorkflowHelpers.cxx @@ -209,8 +209,8 @@ void WorkflowHelpers::addMissingOutputsToBuilder(std::vector&& reques void WorkflowHelpers::injectServiceDevices(WorkflowSpec& workflow, ConfigContext const& ctx) { auto fakeCallback = AlgorithmSpec{[](InitContext& ic) { - LOG(INFO) << "This is not a real device, merely a placeholder for external inputs"; - LOG(INFO) << "To be hidden / removed at some point."; + LOG(info) << "This is not a real device, merely a placeholder for external inputs"; + LOG(info) << "To be hidden / removed at some point."; // mark this dummy process as ready-to-quit ic.services().get().readyToQuit(QuitRequest::Me); @@ -459,7 +459,7 @@ void WorkflowHelpers::injectServiceDevices(WorkflowSpec& workflow, ConfigContext result = uv_dlopen("libO2FrameworkAnalysisSupport.so", &supportLib); #endif if (result == -1) { - LOG(FATAL) << uv_dlerror(&supportLib); + LOG(fatal) << uv_dlerror(&supportLib); return; } void* callback = nullptr; @@ -467,11 +467,11 @@ void WorkflowHelpers::injectServiceDevices(WorkflowSpec& workflow, ConfigContext result = uv_dlsym(&supportLib, "dpl_plugin_callback", (void**)&dpl_plugin_callback); if (result == -1) { - LOG(FATAL) << uv_dlerror(&supportLib); + LOG(fatal) << uv_dlerror(&supportLib); return; } if (dpl_plugin_callback == nullptr) { - LOG(FATAL) << "Could not find the AnalysisSupport plugin."; + LOG(fatal) << "Could not find the AnalysisSupport plugin."; return; } DPLPluginHandle* pluginInstance = dpl_plugin_callback(nullptr); diff --git a/Framework/Core/src/runDataProcessing.cxx b/Framework/Core/src/runDataProcessing.cxx index aa0d75364761c..543340e00be1c 100644 --- a/Framework/Core/src/runDataProcessing.cxx +++ b/Framework/Core/src/runDataProcessing.cxx @@ -1373,7 +1373,7 @@ int runStateMachine(DataProcessorSpecs const& workflow, // driverInfo.states.push_back(DriverState::REDEPLOY_GUI); LOG(info) << "O2 Data Processing Layer initialised. We brake for nobody."; #ifdef NDEBUG - LOGF(info, "Optimised build. O2DEBUG / LOG(debug) / LOGF(DEBUG) / assert statement will not be shown."); + LOGF(info, "Optimised build. O2DEBUG / LOG(debug) / LOGF(debug) / assert statement will not be shown."); #endif break; case DriverState::IMPORT_CURRENT_WORKFLOW: @@ -1427,7 +1427,7 @@ int runStateMachine(DataProcessorSpecs const& workflow, }; bool altered = false; for (auto& device : altered_workflow) { - LOGF(DEBUG, "Adjusting device %s", device.name.c_str()); + LOGF(debug, "Adjusting device %s", device.name.c_str()); // ignore internal devices if (device.name.find("internal") != std::string::npos) { continue; @@ -1468,9 +1468,9 @@ int runStateMachine(DataProcessorSpecs const& workflow, } } /// FIXME: use commandline arguments as alternative - LOGF(DEBUG, "Original inputs: "); + LOGF(debug, "Original inputs: "); for (auto& input : device.inputs) { - LOGF(DEBUG, "-> %s", input.binding); + LOGF(debug, "-> %s", input.binding); } auto end = device.inputs.end(); auto new_end = std::remove_if(device.inputs.begin(), device.inputs.end(), [](InputSpec& input) { @@ -1482,9 +1482,9 @@ int runStateMachine(DataProcessorSpecs const& workflow, }); }); device.inputs.erase(new_end, end); - LOGF(DEBUG, "Adjusted inputs: "); + LOGF(debug, "Adjusted inputs: "); for (auto& input : device.inputs) { - LOGF(DEBUG, "-> %s", input.binding); + LOGF(debug, "-> %s", input.binding); } altered = true; } diff --git a/Framework/Core/test/benchmark_ExternalFairMQDeviceProxies.cxx b/Framework/Core/test/benchmark_ExternalFairMQDeviceProxies.cxx index af9213c61d3c2..623865b889a6b 100644 --- a/Framework/Core/test/benchmark_ExternalFairMQDeviceProxies.cxx +++ b/Framework/Core/test/benchmark_ExternalFairMQDeviceProxies.cxx @@ -54,7 +54,7 @@ using benchclock = std::chrono::high_resolution_clock; #define ASSERT_ERROR(condition) \ if ((condition) == false) { \ - LOG(FATAL) << R"(Test condition ")" #condition R"(" failed)"; \ + LOG(fatal) << R"(Test condition ")" #condition R"(" failed)"; \ } std::vector defineDataProcessing(ConfigContext const& config) diff --git a/Framework/Core/test/test_DataAllocator.cxx b/Framework/Core/test/test_DataAllocator.cxx index 217730b8abb04..70ac05c0749ca 100644 --- a/Framework/Core/test/test_DataAllocator.cxx +++ b/Framework/Core/test/test_DataAllocator.cxx @@ -37,7 +37,7 @@ using namespace o2::framework; #define ASSERT_ERROR(condition) \ if ((condition) == false) { \ - LOG(FATAL) << R"(Test condition ")" #condition R"(" failed)"; \ + LOG(fatal) << R"(Test condition ")" #condition R"(" failed)"; \ } // this function is only used to do the static checks for API return types diff --git a/Framework/Core/test/test_ExternalFairMQDeviceWorkflow.cxx b/Framework/Core/test/test_ExternalFairMQDeviceWorkflow.cxx index ff299fac0d54a..f552f093add36 100644 --- a/Framework/Core/test/test_ExternalFairMQDeviceWorkflow.cxx +++ b/Framework/Core/test/test_ExternalFairMQDeviceWorkflow.cxx @@ -41,7 +41,7 @@ void customize(std::vector& workflowOptions) #define ASSERT_ERROR(condition) \ if ((condition) == false) { \ - LOG(FATAL) << R"(Test condition ")" #condition R"(" failed)"; \ + LOG(fatal) << R"(Test condition ")" #condition R"(" failed)"; \ } std::vector defineDataProcessing(ConfigContext const& config) diff --git a/Framework/Core/test/test_ParallelPipeline.cxx b/Framework/Core/test/test_ParallelPipeline.cxx index d34ee6bbcec7b..58027bf8e8702 100644 --- a/Framework/Core/test/test_ParallelPipeline.cxx +++ b/Framework/Core/test/test_ParallelPipeline.cxx @@ -39,7 +39,7 @@ void customize(std::vector& policies) #define ASSERT_ERROR(condition) \ if ((condition) == false) { \ - LOG(FATAL) << R"(Test condition ")" #condition R"(" failed)"; \ + LOG(fatal) << R"(Test condition ")" #condition R"(" failed)"; \ } using DataHeader = o2::header::DataHeader; diff --git a/Framework/Core/test/test_ProcessorOptions.cxx b/Framework/Core/test/test_ProcessorOptions.cxx index bbadf5b23a062..f91d1023142c5 100644 --- a/Framework/Core/test/test_ProcessorOptions.cxx +++ b/Framework/Core/test/test_ProcessorOptions.cxx @@ -19,7 +19,7 @@ using namespace o2::framework; #define ASSERT_ERROR(condition) \ if ((condition) == false) { \ - LOG(FATAL) << R"(Test condition ")" #condition R"(" failed at )" << __FILE__ << ":" << __LINE__; \ + LOG(fatal) << R"(Test condition ")" #condition R"(" failed at )" << __FILE__ << ":" << __LINE__; \ } // This is how you can define your processing in a declarative way diff --git a/Framework/Core/test/test_StaggeringWorkflow.cxx b/Framework/Core/test/test_StaggeringWorkflow.cxx index b2ef8de7986e9..2a7989159a555 100644 --- a/Framework/Core/test/test_StaggeringWorkflow.cxx +++ b/Framework/Core/test/test_StaggeringWorkflow.cxx @@ -63,7 +63,7 @@ using namespace o2::framework; #define ASSERT_ERROR(condition) \ if ((condition) == false) { \ - LOG(FATAL) << R"(Test condition ")" #condition R"(" failed)"; \ + LOG(fatal) << R"(Test condition ")" #condition R"(" failed)"; \ } constexpr size_t nPipelines = 3; diff --git a/Framework/Core/test/test_Task.cxx b/Framework/Core/test/test_Task.cxx index 94de22765e081..2a18a3194886c 100644 --- a/Framework/Core/test/test_Task.cxx +++ b/Framework/Core/test/test_Task.cxx @@ -16,7 +16,7 @@ #define ASSERT_ERROR(condition) \ if ((condition) == false) { \ - LOG(FATAL) << R"(Test condition ")" #condition R"(" failed at )" << __FILE__ << ":" << __LINE__; \ + LOG(fatal) << R"(Test condition ")" #condition R"(" failed at )" << __FILE__ << ":" << __LINE__; \ } using namespace o2::framework; diff --git a/Framework/Core/test/test_VariablePayloadSequenceWorkflow.cxx b/Framework/Core/test/test_VariablePayloadSequenceWorkflow.cxx index 8190336ff3d8d..e1aff42c22775 100644 --- a/Framework/Core/test/test_VariablePayloadSequenceWorkflow.cxx +++ b/Framework/Core/test/test_VariablePayloadSequenceWorkflow.cxx @@ -48,7 +48,7 @@ void customize(std::vector& policies) #define ASSERT_ERROR(condition) \ if ((condition) == false) { \ - LOG(FATAL) << R"(Test condition ")" #condition R"(" failed)"; \ + LOG(fatal) << R"(Test condition ")" #condition R"(" failed)"; \ } namespace test @@ -217,7 +217,7 @@ std::vector defineDataProcessing(ConfigContext const& config) ASSERT_ERROR(*reinterpret_cast(ref.payload) == sd->initialValue + nSequencePayloads); ++nSequencePayloads; } - //LOG(INFO) << "input " << ref.spec->binding << " has data {" << dh->dataOrigin.as() << "/" << dh->dataDescription.as() << "/" << dh->subSpecification << "}: " << *reinterpret_cast(ref.payload); + //LOG(info) << "input " << ref.spec->binding << " has data {" << dh->dataOrigin.as() << "/" << dh->dataDescription.as() << "/" << dh->subSpecification << "}: " << *reinterpret_cast(ref.payload); } for (auto const& [channel, count] : active) { ++counters[channel]; @@ -239,7 +239,7 @@ std::vector defineDataProcessing(ConfigContext const& config) bool sane = true; for (auto const& [channel, count] : *counters) { if (count != nRolls) { - LOG(FATAL) << "inconsistent event count on input '" << channel << "': " << count << ", expected " << nRolls; + LOG(fatal) << "inconsistent event count on input '" << channel << "': " << count << ", expected " << nRolls; sane = false; } } diff --git a/Framework/TestWorkflows/src/o2DiamondWorkflow.cxx b/Framework/TestWorkflows/src/o2DiamondWorkflow.cxx index 425c23f5236eb..108bdae12e3a9 100644 --- a/Framework/TestWorkflows/src/o2DiamondWorkflow.cxx +++ b/Framework/TestWorkflows/src/o2DiamondWorkflow.cxx @@ -40,7 +40,7 @@ void customize(std::vector& policies) policies.push_back(CallbacksPolicy{ .matcher = DeviceMatchers::matchByName("A"), .policy = [](CallbackService& service, InitContext&) { - service.set(CallbackService::Id::Start, []() { LOG(INFO) << "invoked at start"; }); + service.set(CallbackService::Id::Start, []() { LOG(info) << "invoked at start"; }); }}); } @@ -49,7 +49,7 @@ void customize(std::vector& policies) policies.push_back(SendingPolicy{ .matcher = DeviceMatchers::matchByName("A"), .send = [](FairMQDevice& device, FairMQParts& parts, std::string const& channel) { - LOG(INFO) << "A custom policy for sending invoked!"; + LOG(info) << "A custom policy for sending invoked!"; device.Send(parts, channel, 0); }}); } @@ -60,7 +60,7 @@ AlgorithmSpec simplePipe(std::string const& what, int minDelay) { return AlgorithmSpec{adaptStateful([what, minDelay](RunningWorkflowInfo const& runningWorkflow) { srand(getpid()); - LOG(INFO) << "There are " << runningWorkflow.devices.size() << " devices in the workflow"; + LOG(info) << "There are " << runningWorkflow.devices.size() << " devices in the workflow"; return adaptStateless([what, minDelay](DataAllocator& outputs, RawDeviceService& device) { device.device()->WaitFor(std::chrono::milliseconds(minDelay)); auto& bData = outputs.make(OutputRef{what}, 1); @@ -102,6 +102,6 @@ WorkflowSpec defineDataProcessing(ConfigContext const& specs) AlgorithmSpec{adaptStateless([](InputRecord& inputs) { auto ref = inputs.get("b"); auto header = o2::header::get(ref.header); - LOG(INFO) << header->startTime; + LOG(info) << header->startTime; })}}}; } diff --git a/Framework/TestWorkflows/src/o2DummyWorkflow.cxx b/Framework/TestWorkflows/src/o2DummyWorkflow.cxx index 3dfcd95239e7c..a3ee0ee72fd18 100644 --- a/Framework/TestWorkflows/src/o2DummyWorkflow.cxx +++ b/Framework/TestWorkflows/src/o2DummyWorkflow.cxx @@ -70,7 +70,7 @@ std::vector defineDataProcessing(ConfigContext const&) cluster.q = i; i++; } - // LOG(INFO) << "Invoked" << std::endl; + // LOG(info) << "Invoked" << std::endl; }}}; DataProcessorSpec tpcClusterSummary{ diff --git a/Framework/TestWorkflows/src/test_o2RootMessageWorkflow.cxx b/Framework/TestWorkflows/src/test_o2RootMessageWorkflow.cxx index 20e578798ac0c..59641ab42a0d9 100644 --- a/Framework/TestWorkflows/src/test_o2RootMessageWorkflow.cxx +++ b/Framework/TestWorkflows/src/test_o2RootMessageWorkflow.cxx @@ -46,7 +46,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const&) singleHisto.FillRandom("gaus", 1000); Double_t stats[4]; singleHisto.GetStats(stats); - LOG(INFO) << "sumw" << stats[0] << "\n" + LOG(info) << "sumw" << stats[0] << "\n" << "sumw2" << stats[1] << "\n" << "sumwx" << stats[2] << "\n" << "sumwx2" << stats[3] << "\n"; @@ -69,12 +69,12 @@ WorkflowSpec defineDataProcessing(ConfigContext const&) } Double_t stats[4]; h->GetStats(stats); - LOG(INFO) << "sumw" << stats[0] << "\n" + LOG(info) << "sumw" << stats[0] << "\n" << "sumw2" << stats[1] << "\n" << "sumwx" << stats[2] << "\n" << "sumwx2" << stats[3] << "\n"; auto s = ctx.inputs().get("string"); - LOG(INFO) << "String is " << s->GetString().Data(); + LOG(info) << "String is " << s->GetString().Data(); }}}}; } diff --git a/Framework/Utils/include/DPLUtils/MakeRootTreeWriterSpec.h b/Framework/Utils/include/DPLUtils/MakeRootTreeWriterSpec.h index a56e75e70abcb..e8c1b9ff452b0 100644 --- a/Framework/Utils/include/DPLUtils/MakeRootTreeWriterSpec.h +++ b/Framework/Utils/include/DPLUtils/MakeRootTreeWriterSpec.h @@ -376,7 +376,7 @@ class MakeRootTreeWriterSpec auto outdir = ic.options().get("output-dir"); processAttributes->nEvents = ic.options().get("nevents"); if (processAttributes->nEvents > 0 && processAttributes->activeInputs.size() != processAttributes->nofBranches) { - LOG(WARNING) << "the n inputs serve in total m branches with n != m, this means that there will be data for\n" + LOG(warning) << "the n inputs serve in total m branches with n != m, this means that there will be data for\n" << "different branches on the same input. Be aware that the --nevents option might lead to incomplete\n" << "data in the output file as the number of processed input sets is counted"; } diff --git a/Framework/Utils/include/DPLUtils/RootTreeReader.h b/Framework/Utils/include/DPLUtils/RootTreeReader.h index 97d518653fa45..427241708ea6d 100644 --- a/Framework/Utils/include/DPLUtils/RootTreeReader.h +++ b/Framework/Utils/include/DPLUtils/RootTreeReader.h @@ -279,13 +279,13 @@ class GenericRootTreeReader if (classinfo == nullptr) { throw std::runtime_error(std::string("can not find class description for branch ") + mName); } - LOG(INFO) << "branch set up: " << mName; + LOG(info) << "branch set up: " << mName; } else { if (classinfo == nullptr || classinfo != TClass::GetClass(typeid(BinaryDataStoreType))) { throw std::runtime_error("mismatching class type, expecting std::vector for binary branch"); } mSizeBranch = sizebranch; - LOG(INFO) << "binary branch set up: " << mName; + LOG(info) << "binary branch set up: " << mName; } mClassInfo = classinfo; } else { @@ -322,7 +322,7 @@ class GenericRootTreeReader mSizeBranch->GetEntry(entry); auto* buffer = reinterpret_cast(data); if (buffer->size() == datasize) { - LOG(INFO) << "branch " << mName << ": publishing binary chunk of " << datasize << " bytes(s)"; + LOG(info) << "branch " << mName << ": publishing binary chunk of " << datasize << " bytes(s)"; snapshot(mKey, std::move(*buffer)); } else { LOG(error) << "branch " << mName << ": inconsitent size of binary chunk " diff --git a/Framework/Utils/include/DPLUtils/RootTreeWriter.h b/Framework/Utils/include/DPLUtils/RootTreeWriter.h index 441d16728ad04..74345f9ce5c5b 100644 --- a/Framework/Utils/include/DPLUtils/RootTreeWriter.h +++ b/Framework/Utils/include/DPLUtils/RootTreeWriter.h @@ -372,7 +372,7 @@ class RootTreeWriter return; } mTree->SetEntries(); - LOG(INFO) << "Autosaving " << mTree->GetName() << " at entry " << mTree->GetEntries(); + LOG(info) << "Autosaving " << mTree->GetName() << " at entry " << mTree->GetEntries(); mTree->AutoSave("overwrite"); } @@ -608,7 +608,7 @@ class RootTreeWriter if (specs[SpecIndex].branches.at(branchIdx) == nullptr) { throw std::runtime_error(std::to_string(SpecIndex) + ": can not create branch " + name + " for type " + typeid(value_type).name() + " - LinkDef entry missing?"); } - LOG(INFO) << SpecIndex << ": branch " << name << " set up"; + LOG(info) << SpecIndex << ": branch " << name << " set up"; branchIdx++; } } diff --git a/Framework/Utils/src/raw-parser.cxx b/Framework/Utils/src/raw-parser.cxx index e0d5a2da97faa..071a8c1466f86 100644 --- a/Framework/Utils/src/raw-parser.cxx +++ b/Framework/Utils/src/raw-parser.cxx @@ -63,7 +63,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& config) if (loglevel > 0) { if (dh != lastDataHeader) { if (!rdhprintout.str().empty()) { - LOG(INFO) << rdhprintout.str(); + LOG(info) << rdhprintout.str(); rdhprintout.str(std::string()); } // print the DataHeader information only for the first part or if we have high verbosity @@ -93,7 +93,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& config) lastDataHeader = dh; } if (loglevel > 0) { - LOG(INFO) << rdhprintout.str(); + LOG(info) << rdhprintout.str(); } }); }}, Options{ diff --git a/Framework/Utils/test/DPLBroadcasterMerger.cxx b/Framework/Utils/test/DPLBroadcasterMerger.cxx index 2535e1a052d90..bf793275d2f3f 100644 --- a/Framework/Utils/test/DPLBroadcasterMerger.cxx +++ b/Framework/Utils/test/DPLBroadcasterMerger.cxx @@ -40,7 +40,7 @@ o2f::DataProcessorSpec defineGenerator(o2f::OutputSpec usrOutput) auto msgCounter_shptr = std::make_shared(msgCounter); auto usrOutput_shptr = std::make_shared(getOutput(usrOutput)); - LOG(INFO) << ">>>>>>>>>>>>>> Generator initialised"; + LOG(info) << ">>>>>>>>>>>>>> Generator initialised"; // Processing context in captured from return on InitCallback return [usrOutput_shptr, msgCounter_shptr](o2f::ProcessingContext& ctx) { @@ -48,25 +48,25 @@ o2f::DataProcessorSpec defineGenerator(o2f::OutputSpec usrOutput) if (msgIndex > 10) { ctx.services().get().endOfStream(); } - LOG(INFO) << ">>> MSG:" << msgIndex; + LOG(info) << ">>> MSG:" << msgIndex; std::this_thread::sleep_for(std::chrono::milliseconds(1000)); - LOG(INFO) << ">>> Preparing MSG:" << msgIndex; + LOG(info) << ">>> Preparing MSG:" << msgIndex; auto& outputMsg = ctx.outputs().newChunk(*usrOutput_shptr, (msgIndex + 1) * sizeof(uint32_t) / sizeof(char)); - LOG(INFO) << ">>> Preparing1 MSG:" << msgIndex; + LOG(info) << ">>> Preparing1 MSG:" << msgIndex; auto payload = reinterpret_cast(outputMsg.data()); payload[0] = msgIndex; - LOG(INFO) << ">>> Preparing2 MSG:" << msgIndex; + LOG(info) << ">>> Preparing2 MSG:" << msgIndex; for (int k = 0; k < msgIndex; ++k) { payload[k + 1] = (uint32_t)32; - LOG(INFO) << ">>>>\t" << payload[k + 1]; + LOG(info) << ">>>>\t" << payload[k + 1]; } return; @@ -101,17 +101,17 @@ o2f::DataProcessorSpec defineSink(o2f::InputSpec usrInput) o2f::AlgorithmSpec{[](o2f::InitContext&) { // Processing context in captured from return on InitCallback return [](o2f::ProcessingContext& ctx) { - LOG(INFO) << "Received message "; + LOG(info) << "Received message "; auto inputMsg = ctx.inputs().getByPos(0); auto payload = reinterpret_cast(inputMsg.payload); - LOG(INFO) << "Received message containing" << payload[0] << "elements"; + LOG(info) << "Received message containing" << payload[0] << "elements"; for (int j = 0; j < payload[0]; ++j) { - LOG(INFO) << payload[j + 1] << "\t"; + LOG(info) << payload[j + 1] << "\t"; } - LOG(INFO); + LOG(info); }; }}}; } diff --git a/Framework/Utils/test/DPLOutputTest.cxx b/Framework/Utils/test/DPLOutputTest.cxx index 4bc75d4299285..df0d69c8d6710 100644 --- a/Framework/Utils/test/DPLOutputTest.cxx +++ b/Framework/Utils/test/DPLOutputTest.cxx @@ -34,7 +34,7 @@ o2f::DataProcessorSpec defineTestGenerator() int msgCounter = 0; auto msgCounter_shptr = std::make_shared(msgCounter); - LOG(INFO) << ">>>>>>>>>>>>>> Generator initialised\n"; + LOG(info) << ">>>>>>>>>>>>>> Generator initialised\n"; // Processing context in captured from return on InitCallback return [msgCounter_shptr](o2f::ProcessingContext& ctx) { @@ -42,27 +42,27 @@ o2f::DataProcessorSpec defineTestGenerator() if (msgIndex > 10) { ctx.services().get().endOfStream(); } - LOG(INFO) << ">>> MSG:" << msgIndex << "\n"; + LOG(info) << ">>> MSG:" << msgIndex << "\n"; - LOG(INFO) << ">>> Preparing MSG:" << msgIndex; + LOG(info) << ">>> Preparing MSG:" << msgIndex; auto& outputMsg = ctx.outputs().newChunk({"TST", "ToSink", 0, o2f::Lifetime::Timeframe}, (31 + 1) * sizeof(uint32_t) / sizeof(char)); - LOG(INFO) << ">>> Preparing1 MSG:" << msgIndex; + LOG(info) << ">>> Preparing1 MSG:" << msgIndex; auto payload = reinterpret_cast(outputMsg.data()); payload[0] = msgIndex; - LOG(INFO) << ">>> Preparing2 MSG:" << msgIndex; + LOG(info) << ">>> Preparing2 MSG:" << msgIndex; for (int k = 0; k < 31; ++k) { payload[k + 1] = (uint32_t)k; - LOG(INFO) << ">>>>\t" << payload[k + 1]; + LOG(info) << ">>>>\t" << payload[k + 1]; } - LOG(INFO) << ">>> Done MSG:" << msgIndex; + LOG(info) << ">>> Done MSG:" << msgIndex; }; }}}; } @@ -74,16 +74,16 @@ o2f::DataProcessorSpec defineTestSink() {}, o2f::AlgorithmSpec{[](o2f::InitContext&) { - LOG(INFO) << ">>>>>>>>>>>>>> Sink initialised\n"; + LOG(info) << ">>>>>>>>>>>>>> Sink initialised\n"; // Processing context in captured from return on InitCallback return [](o2f::ProcessingContext& ctx) { auto inputMsg = ctx.inputs().getByPos(0); auto payload = reinterpret_cast(inputMsg.payload); - LOG(INFO) << "Received message containing" << payload[0] << "elements\n"; + LOG(info) << "Received message containing" << payload[0] << "elements\n"; for (int j = 0; j < payload[0]; ++j) { - LOG(INFO) << payload[j]; + LOG(info) << payload[j]; } }; }}}; diff --git a/Framework/Utils/test/test_DPLRawPageSequencer.cxx b/Framework/Utils/test/test_DPLRawPageSequencer.cxx index 671efb18f5159..1bcefd0cb25cd 100644 --- a/Framework/Utils/test/test_DPLRawPageSequencer.cxx +++ b/Framework/Utils/test/test_DPLRawPageSequencer.cxx @@ -96,8 +96,8 @@ BOOST_AUTO_TEST_CASE(test_DPLRawPageSequencer) }; DPLRawPageSequencer(inputs).forward(isSameRdh, insertForwardPages); - LOG(INFO) << "called RDH amend: " << rdhCount; - LOG(INFO) << "created " << feeids.size() << " id(s), got " << pages.size() << " page(s)"; + LOG(info) << "called RDH amend: " << rdhCount; + LOG(info) << "created " << feeids.size() << " id(s), got " << pages.size() << " page(s)"; BOOST_REQUIRE(pages.size() == feeids.size()); BOOST_REQUIRE(pages.size() == pagesByForwardSearch.size()); diff --git a/Framework/Utils/test/test_DPLRawParser.cxx b/Framework/Utils/test/test_DPLRawParser.cxx index befaace1c94e4..13bbc82204c0c 100644 --- a/Framework/Utils/test/test_DPLRawParser.cxx +++ b/Framework/Utils/test/test_DPLRawParser.cxx @@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE(test_DPLRawParser) int count = 0; o2::header::DataHeader const* last = nullptr; for (auto it = parser.begin(), end = parser.end(); it != end; ++it, ++count) { - LOG(INFO) << "data " << count << " " << *((int*)it.data()); + LOG(info) << "data " << count << " " << *((int*)it.data()); // now check the iterator API // retrieving RDH auto const* rdh = it.get_if(); @@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE(test_DPLRawParser) DPLRawParser filteredparser(inputs, o2::framework::select("its:ITS/RAWDATA")); count = 5; for (auto it = filteredparser.begin(), end = filteredparser.end(); it != end; ++it, ++count) { - LOG(INFO) << "data " << count << " " << *((int*)it.data()); + LOG(info) << "data " << count << " " << *((int*)it.data()); BOOST_REQUIRE(*reinterpret_cast(it.data()) == dataset.values[count]); } @@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE(test_DPLRawParser) DPLRawParser nomatchingparser(inputs, o2::framework::select("nmatch:NO/MATCH")); count = 0; for (auto it = nomatchingparser.begin(), end = nomatchingparser.end(); it != end; ++it, ++count) { - LOG(INFO) << "data " << count << " " << *((int*)it.data()); + LOG(info) << "data " << count << " " << *((int*)it.data()); } BOOST_CHECK(count == 0); } diff --git a/Framework/Utils/test/test_RootTreeReader.cxx b/Framework/Utils/test/test_RootTreeReader.cxx index e723ba641f931..0390a29f807b1 100644 --- a/Framework/Utils/test/test_RootTreeReader.cxx +++ b/Framework/Utils/test/test_RootTreeReader.cxx @@ -33,7 +33,7 @@ using namespace o2::framework; #define ASSERT_ERROR(condition) \ if ((condition) == false) { \ - LOG(FATAL) << R"(Test condition ")" #condition R"(" failed)"; \ + LOG(fatal) << R"(Test condition ")" #condition R"(" failed)"; \ } const int gTreeSize = 10; // elements in the test tree @@ -111,7 +111,7 @@ DataProcessorSpec getSinkSpec() using DataHeader = o2::header::DataHeader; for (auto& input : pc.inputs()) { auto dh = DataRefUtils::getHeader(input); - LOG(INFO) << dh->dataOrigin.str << " " << dh->dataDescription.str << " " << dh->payloadSize; + LOG(info) << dh->dataOrigin.str << " " << dh->dataDescription.str << " " << dh->payloadSize; } auto data = pc.inputs().get>("input1"); if (counter == 0) { @@ -126,7 +126,7 @@ DataProcessorSpec getSinkSpec() } } - LOG(INFO) << "count: " << counter << " data elements:" << data.size(); + LOG(info) << "count: " << counter << " data elements:" << data.size(); ASSERT_ERROR(counter + 1 == data.size()); // retrieving the unserialized message as vector @@ -138,7 +138,7 @@ DataProcessorSpec getSinkSpec() ASSERT_ERROR(counter + 1 == msgblspan.size()); for (unsigned int idx = 0; idx < data.size(); idx++) { - LOG(INFO) << data[idx].get(); + LOG(info) << data[idx].get(); auto expected = 10 * counter + idx; ASSERT_ERROR(data[idx].get() == expected); ASSERT_ERROR(((*msgblvec)[idx] == o2::test::TriviallyCopyable{expected, 0, 0}));