From 28c7dbb27931d76c207627ddf10e7ada768232fc Mon Sep 17 00:00:00 2001 From: Javier Galan Date: Mon, 3 Jul 2023 18:45:10 +0200 Subject: [PATCH 1/3] TRestMetadata. SetWarning/Error now only registers the last warning/error message --- source/framework/core/src/TRestMetadata.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/framework/core/src/TRestMetadata.cxx b/source/framework/core/src/TRestMetadata.cxx index 35e9d6fc6..f02e50ea6 100644 --- a/source/framework/core/src/TRestMetadata.cxx +++ b/source/framework/core/src/TRestMetadata.cxx @@ -2621,18 +2621,23 @@ void TRestMetadata::SetError(string message, bool print) { fError = true; fNErrors++; if (message != "") { - fErrorMessage += message + "\n"; + // We keep only the last error message + fErrorMessage = message + "\n"; if (print) { cout << message << endl; } } } -void TRestMetadata::SetWarning(string message, bool print) { +/////////////////////////////////////////////// +/// \brief It retrieves a map of all parameter:value found in the metadata class +/// +void TRestMetadata::SetWarning(string message, bool print, bool onlyFirst) { fWarning = true; fNWarnings++; if (message != "") { - fWarningMessage += message + "\n"; + // We keep only the last warning message + fWarningMessage = message + "\n"; if (print) { RESTWarning << message << RESTendl; } From 00e39b50aa7ae3faa9110e649c464c7a81dcfb4e Mon Sep 17 00:00:00 2001 From: Javier Galan Date: Mon, 3 Jul 2023 18:45:40 +0200 Subject: [PATCH 2/3] TRestThread. Improving output message --- source/framework/core/src/TRestThread.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/source/framework/core/src/TRestThread.cxx b/source/framework/core/src/TRestThread.cxx index 1b56c0186..f85cc8a5c 100644 --- a/source/framework/core/src/TRestThread.cxx +++ b/source/framework/core/src/TRestThread.cxx @@ -585,13 +585,21 @@ void TRestThread::EndProcess() { if (fProcessChain[i]->GetWarning()) nWarnings++; } - if (nWarnings) + if (nWarnings) { RESTWarning << nWarnings - << " process warnings were found! Use run0->PrintWarnings(); to get additional info." + << " process warnings were found! Check them inside the generated root file: " << RESTendl; - if (nErrors) + RESTWarning << "restRoot output.root" << RESTendl; + RESTWarning << "[0] run->PrintWarnings(); to get additional info." << RESTendl; + } + if (nErrors) { RESTError << nErrors << " process errors were found! Use run0->PrintErrors(); to get additional info." << RESTendl; + RESTError << nErrors + << " process errors were found! Check them inside the generated root file: " << RESTendl; + RESTError << "restRoot output.root" << RESTendl; + RESTError << "[0] run->PrintErrors(); to get additional info." << RESTendl; + } delete fAnalysisTree; } From 0299bff4f4f7aadbc649e3795b18367e4d59c683 Mon Sep 17 00:00:00 2001 From: Javier Galan Date: Mon, 3 Jul 2023 22:05:39 +0200 Subject: [PATCH 3/3] TRestMetadata::SetWarning fixing compilation issue --- source/framework/core/src/TRestMetadata.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/framework/core/src/TRestMetadata.cxx b/source/framework/core/src/TRestMetadata.cxx index f02e50ea6..27fbd1346 100644 --- a/source/framework/core/src/TRestMetadata.cxx +++ b/source/framework/core/src/TRestMetadata.cxx @@ -2632,7 +2632,7 @@ void TRestMetadata::SetError(string message, bool print) { /////////////////////////////////////////////// /// \brief It retrieves a map of all parameter:value found in the metadata class /// -void TRestMetadata::SetWarning(string message, bool print, bool onlyFirst) { +void TRestMetadata::SetWarning(string message, bool print) { fWarning = true; fNWarnings++; if (message != "") {