diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2024-05-17 17:58:38 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2024-05-17 17:58:38 +0200 |
| commit | 577fc0845718ed8ad5bebf02a277c0579a817f77 (patch) | |
| tree | 3d1cdc53c426a0ba60a7996619a7b787850bb3b3 /source/lib/include/wanda/system/logging.hpp | |
| parent | de5bf7ca3b7a2bf6be35b86486b00dc6a071b950 (diff) | |
| download | wanda-develop.tar.xz wanda-develop.zip | |
Diffstat (limited to 'source/lib/include/wanda/system/logging.hpp')
| -rw-r--r-- | source/lib/include/wanda/system/logging.hpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/source/lib/include/wanda/system/logging.hpp b/source/lib/include/wanda/system/logging.hpp new file mode 100644 index 0000000..8a9a90e --- /dev/null +++ b/source/lib/include/wanda/system/logging.hpp @@ -0,0 +1,35 @@ +/** + * @file logging.hpp + * @author Felix Morgner (felix.morgner@gmail.com) + * @since 1.0.0 + */ + +#ifndef WANDA_SYSTEM_LOGGING_HPP +#define WANDA_SYSTEM_LOGGING_HPP + +#include <spdlog/sinks/null_sink.h> +#include <spdlog/spdlog.h> + +#include <memory> + +namespace wanda::system +{ + /** + * @brief A covenience alias to represent a handle for a logger + */ + using logger_ptr = std::shared_ptr<spdlog::logger>; + + /** + * @brief Initialize the shared logger + * + * @note The logger will only ever be initialized once, even if this function is called multiple times + */ + void initialize_logger(spdlog::sink_ptr sink = std::make_shared<spdlog::sinks::null_sink_st>()); + + /** + * @brief Get the shared logger + */ + logger_ptr get_logger(); +} // namespace wanda::system + +#endif
\ No newline at end of file |
