From 362b3650bdc28beee33324328f3b5602dadf9105 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Thu, 27 Apr 2023 14:45:34 +0200 Subject: Write log error and flush log before reporting error to Sentry/error logger --- CHANGELOG.md | 1 + zencore/include/zencore/logging.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8da122a2..cb8051158 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## - Bugfix: Verify that there are blocks to GC for block store garbage collect (void division by zero) +- Bugfix: Write log error and flush log before reporting error to Sentry/error logger - Bugfix: Log ERROR in scope guard if function throws exception, throwing exception causes application abort ## 0.2.7 diff --git a/zencore/include/zencore/logging.h b/zencore/include/zencore/logging.h index 44e3d40d4..5cbe034cf 100644 --- a/zencore/include/zencore/logging.h +++ b/zencore/include/zencore/logging.h @@ -67,6 +67,7 @@ LogIsErrorLevel(int level) using namespace std::literals; \ if (logger.should_log(level)) \ { \ + logger.log(loc, level, fmtstr, ##__VA_ARGS__); \ if (LogIsErrorLevel(level)) \ { \ if (auto ErrLogger = zen::logging::ErrorLog(); ErrLogger != nullptr) \ @@ -74,7 +75,6 @@ LogIsErrorLevel(int level) ErrLogger->log(loc, level, fmtstr, ##__VA_ARGS__); \ } \ } \ - logger.log(loc, level, fmtstr, ##__VA_ARGS__); \ } \ } while (false); -- cgit v1.2.3