From 2b9bed6635d95e15847c4d9b602e34d90e277d14 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Wed, 15 Sep 2021 11:27:48 +0200 Subject: Changed logging implementation * Code should no longer directly `#include spdlog/spdlog.h`, instead use `#include ` * Instead of explicit calls to `spdlog::info(...)` and such please use the logging macros defined in `zencore/logging.h`. I.e `ZEN_INFO`, `ZEN_DEBUG`, `ZEN_TRACE`, `ZEN_ERROR`, `ZEN_CRITITCAL` * The macros will pick up the "most local" logger via a `Log()` call to retrieve a logger instance. To override the default logger in a class please implement your own `Log()` function --- zencore/logging.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'zencore/logging.cpp') diff --git a/zencore/logging.cpp b/zencore/logging.cpp index 6441fc3bc..9d5a726f5 100644 --- a/zencore/logging.cpp +++ b/zencore/logging.cpp @@ -4,6 +4,16 @@ #include +namespace zen { + +spdlog::logger& +Log() +{ + return *spdlog::default_logger(); +} + +} // namespace zen + namespace zen::logging { spdlog::logger& -- cgit v1.2.3