Skip to content

Commit

Permalink
Disable logging of ATLAS_TRACE during stack unwinding (e.g. when exce…
Browse files Browse the repository at this point in the history
…ption is thrown)
  • Loading branch information
wdeconinck committed Apr 25, 2024
1 parent 55a7ee8 commit 8beb990
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/atlas/runtime/trace/Logging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "Logging.h"

#include <iostream>
#include <exception>

#include "eckit/log/Channel.h"

Expand Down Expand Up @@ -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;
}
}
}
//-----------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 8beb990

Please sign in to comment.