aboutsummaryrefslogtreecommitdiff
path: root/include/wanda/logging.hpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2018-12-11 07:42:05 +0100
committerFelix Morgner <felix.morgner@gmail.com>2018-12-11 07:42:05 +0100
commited419140280553b070943b7ba539120a26ff5686 (patch)
tree3d134977a6dfae71a45c318305166d044b50320d /include/wanda/logging.hpp
parentd3e691c9200b7b782c8acf17468068a699588a73 (diff)
downloadwanda-ed419140280553b070943b7ba539120a26ff5686.tar.xz
wanda-ed419140280553b070943b7ba539120a26ff5686.zip
wanda: restructure directory hierarchy
Diffstat (limited to 'include/wanda/logging.hpp')
-rw-r--r--include/wanda/logging.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/wanda/logging.hpp b/include/wanda/logging.hpp
new file mode 100644
index 0000000..b3c1665
--- /dev/null
+++ b/include/wanda/logging.hpp
@@ -0,0 +1,35 @@
+/**
+ * @file logging.hpp
+ * @author Felix Morgner (felix.morgner@gmail.com)
+ * @since 1.0.0
+ */
+
+#ifndef WANDA_LOGGING_HPP
+#define WANDA_LOGGING_HPP
+
+#include <spdlog/sinks/null_sink.h>
+#include <spdlog/spdlog.h>
+
+#include <memory>
+
+namespace wanda
+{
+ /**
+ * @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
+
+#endif \ No newline at end of file