diff options
Diffstat (limited to 'source/lib/system/src/logging.cpp')
| -rw-r--r-- | source/lib/system/src/logging.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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<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::system
\ No newline at end of file |
