From 01997ee032dd83f2b6212d323324ed5f5395c40a Mon Sep 17 00:00:00 2001 From: Leonhard Reichenbach Date: Wed, 17 Apr 2024 08:46:27 +0200 Subject: [PATCH] Harmonize verbosities --- .../k4MarlinWrapper/MarlinProcessorWrapper.h | 2 +- .../src/components/MarlinProcessorWrapper.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/k4MarlinWrapper/k4MarlinWrapper/MarlinProcessorWrapper.h b/k4MarlinWrapper/k4MarlinWrapper/MarlinProcessorWrapper.h index fc3f3bbc..ae7a2eef 100644 --- a/k4MarlinWrapper/k4MarlinWrapper/MarlinProcessorWrapper.h +++ b/k4MarlinWrapper/k4MarlinWrapper/MarlinProcessorWrapper.h @@ -65,7 +65,7 @@ class MarlinProcessorWrapper : public GaudiAlgorithm { virtual StatusCode initialize() override final; private: - std::string m_verbosity = "MESSAGE"; + std::string m_verbosity = "ERROR"; marlin::Processor* m_processor = nullptr; /// Load libraries specified by MARLIN_DLL environment variable diff --git a/k4MarlinWrapper/src/components/MarlinProcessorWrapper.cpp b/k4MarlinWrapper/src/components/MarlinProcessorWrapper.cpp index 67dfced6..619e84d6 100644 --- a/k4MarlinWrapper/src/components/MarlinProcessorWrapper.cpp +++ b/k4MarlinWrapper/src/components/MarlinProcessorWrapper.cpp @@ -168,6 +168,24 @@ StatusCode MarlinProcessorWrapper::initialize() { } } + // Set m_verbosity from OutputLevel of the MarlinProcessorWrapper + MSG::Level outputLevel = msgLevel(); + switch (outputLevel) { + case MSG::ERROR: + m_verbosity = "ERROR"; + break; + case MSG::WARNING: + m_verbosity = "WARNING"; + break; + case MSG::INFO: + m_verbosity = "MESSAGE"; + break; + case MSG::DEBUG: + m_verbosity = "DEBUG"; + break; + } + + // pass m_verbosity to overwrite it if explicitly stated in wrapped parameters auto parameters = parseParameters(m_parameters, m_verbosity); if (instantiateProcessor(parameters, m_processorType).isFailure()) { return StatusCode::FAILURE;