aboutsummaryrefslogtreecommitdiff
path: root/source/lib/include/wanda/logging.hpp
blob: b3c1665e49d7c1e6590f1f623597288a60e8c79f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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