diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2022-09-16 21:36:12 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2022-09-16 21:36:12 +0200 |
| commit | 64922e213ac731279cf3341253e67509adb2dfc8 (patch) | |
| tree | ddcf4fd5b05ac426ecf032e43e8662c2f9ce0f57 /source/src/wanda/logging.cpp | |
| parent | d22bc7b557d36da41fe88d3188a7cd335c3ccaa0 (diff) | |
| download | wanda-64922e213ac731279cf3341253e67509adb2dfc8.tar.xz wanda-64922e213ac731279cf3341253e67509adb2dfc8.zip | |
wanda: restructure source directory
Diffstat (limited to 'source/src/wanda/logging.cpp')
| -rw-r--r-- | source/src/wanda/logging.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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 <wanda/logging.hpp> + +namespace wanda +{ + std::function<void(spdlog::sink_ptr)> initializer = [](spdlog::sink_ptr sink) { + spdlog::register_logger(std::make_shared<spdlog::logger>("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 |
