From 8beb990df8244350b282eae5e77e0c67d6ed01cb Mon Sep 17 00:00:00 2001 From: Willem Deconinck Date: Thu, 25 Apr 2024 13:24:48 +0000 Subject: [PATCH] Disable logging of ATLAS_TRACE during stack unwinding (e.g. when exception is thrown) --- src/atlas/runtime/trace/Logging.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/atlas/runtime/trace/Logging.cc b/src/atlas/runtime/trace/Logging.cc index 254906337..b9d6cd7ee 100644 --- a/src/atlas/runtime/trace/Logging.cc +++ b/src/atlas/runtime/trace/Logging.cc @@ -11,6 +11,7 @@ #include "Logging.h" #include +#include #include "eckit/log/Channel.h" @@ -87,7 +88,9 @@ void Logging::start(const std::string& title) { void Logging::stop(const std::string& title, double seconds) { if (enabled()) { - channel() << title << " ... done : " << seconds << "s" << std::endl; + if (!std::uncaught_exception()){ + channel() << title << " ... done : " << seconds << "s" << std::endl; + } } } //-----------------------------------------------------------------------------------------------------------