diff options
| author | Dan Engelbrecht <[email protected]> | 2023-04-27 14:45:34 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2023-04-27 14:45:34 +0200 |
| commit | 362b3650bdc28beee33324328f3b5602dadf9105 (patch) | |
| tree | 0d0126f99a696e722b77e8a1e92a38e0f772d027 | |
| parent | made Ref<> constructor explicit (#262) (diff) | |
| download | zen-362b3650bdc28beee33324328f3b5602dadf9105.tar.xz zen-362b3650bdc28beee33324328f3b5602dadf9105.zip | |
Write log error and flush log before reporting error to Sentry/error logger
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | zencore/include/zencore/logging.h | 2 |
2 files changed, 2 insertions, 1 deletions
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); |