diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2022-09-16 23:28:09 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2022-09-16 23:28:09 +0200 |
| commit | f4d9880d3c9555b48affad727589ef5c093b1841 (patch) | |
| tree | a5552b5a33000a527748ac1c72ca366476af0936 /source/lib/src/logging.cpp | |
| parent | 64922e213ac731279cf3341253e67509adb2dfc8 (diff) | |
| download | wanda-f4d9880d3c9555b48affad727589ef5c093b1841.tar.xz wanda-f4d9880d3c9555b48affad727589ef5c093b1841.zip | |
source: clean up structure
Diffstat (limited to 'source/lib/src/logging.cpp')
| -rw-r--r-- | source/lib/src/logging.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/lib/src/logging.cpp b/source/lib/src/logging.cpp new file mode 100644 index 0000000..0aa7e40 --- /dev/null +++ b/source/lib/src/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 |
