diff options
| author | Dan Engelbrecht <[email protected]> | 2023-05-11 16:07:40 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-11 16:07:40 +0200 |
| commit | 2cd31bef444c1ecae9b7e4ef7ca43b9f5dd4222d (patch) | |
| tree | 52858d5ec03986f6fc4f28224c64a69c57e49b7c /src/zencore | |
| parent | clang-format (sorry) (diff) | |
| download | zen-2cd31bef444c1ecae9b7e4ef7ca43b9f5dd4222d.tar.xz zen-2cd31bef444c1ecae9b7e4ef7ca43b9f5dd4222d.zip | |
allow early logging (#292)
* if logging is not initialized, just log to console
* changelog
Diffstat (limited to 'src/zencore')
| -rw-r--r-- | src/zencore/include/zencore/logging.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/zencore/include/zencore/logging.h b/src/zencore/include/zencore/logging.h index c40af1310..6a8fd7254 100644 --- a/src/zencore/include/zencore/logging.h +++ b/src/zencore/include/zencore/logging.h @@ -31,6 +31,10 @@ extern spdlog::logger* TheDefaultLogger; inline spdlog::logger& Log() { + if (TheDefaultLogger == nullptr) + { + return zen::logging::ConsoleLog(); + } return *TheDefaultLogger; } |