From 64922e213ac731279cf3341253e67509adb2dfc8 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 16 Sep 2022 21:36:12 +0200 Subject: wanda: restructure source directory --- source/src/wanda/logging.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 source/src/wanda/logging.cpp (limited to 'source/src/wanda/logging.cpp') diff --git a/source/src/wanda/logging.cpp b/source/src/wanda/logging.cpp new file mode 100644 index 0000000..8c61953 --- /dev/null +++ b/source/src/wanda/logging.cpp @@ -0,0 +1,21 @@ +#include + +namespace wanda +{ + 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 \ No newline at end of file -- cgit v1.2.3