diff options
| author | Stefan Boberg <[email protected]> | 2021-09-15 16:17:22 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-15 16:17:22 +0200 |
| commit | 2fc15e320c934424bc03601551f34f26a38e40a3 (patch) | |
| tree | afaf187ad71c5111bf928355c10099b938f4846a /zencore/include | |
| parent | Changed `std::exception` into `std::runtime_error` since `std::exception` doe... (diff) | |
| download | zen-2fc15e320c934424bc03601551f34f26a38e40a3.tar.xz zen-2fc15e320c934424bc03601551f34f26a38e40a3.zip | |
Tweaked logging to streamline access, and simplified setup code for new loggers
Diffstat (limited to 'zencore/include')
| -rw-r--r-- | zencore/include/zencore/logging.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/zencore/include/zencore/logging.h b/zencore/include/zencore/logging.h index 4996463fd..4eee20414 100644 --- a/zencore/include/zencore/logging.h +++ b/zencore/include/zencore/logging.h @@ -13,6 +13,7 @@ namespace zen::logging { spdlog::logger& Default(); +void SetDefault(std::shared_ptr<spdlog::logger> NewDefaultLogger); spdlog::logger& ConsoleLog(); spdlog::logger& Get(std::string_view Name); @@ -22,7 +23,14 @@ void ShutdownLogging(); } // namespace zen::logging namespace zen { -spdlog::logger& Log(); +extern spdlog::logger* TheDefaultLogger; + +inline spdlog::logger& +Log() +{ + return *TheDefaultLogger; +} + using logging::ConsoleLog; } // namespace zen |