From 375799fa79d1af76f33299acc20a11a167a021f8 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 17 Aug 2023 12:32:50 +0200 Subject: project: restructure libraries and build env --- source/lib/system/src/logging.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 source/lib/system/src/logging.cpp (limited to 'source/lib/system/src/logging.cpp') diff --git a/source/lib/system/src/logging.cpp b/source/lib/system/src/logging.cpp new file mode 100644 index 0000000..83dc9f6 --- /dev/null +++ b/source/lib/system/src/logging.cpp @@ -0,0 +1,21 @@ +#include "wanda/system/logging.hpp" + +namespace wanda::system +{ + std::function initializer = [](spdlog::sink_ptr sink) { + spdlog::register_logger(std::make_shared("wanda", sink)); + initializer = [](auto) {}; + }; + + void initialize_logger(spdlog::sink_ptr sink) + { + initializer(sink); + } + + logger_ptr get_logger() + { + initialize_logger(); + return spdlog::get("wanda"); + } + +} // namespace wanda::system \ No newline at end of file -- cgit v1.2.3