OGS
Logging.h
Go to the documentation of this file.
1
11
12#pragma once
13
14#include <spdlog/logger.h>
15
16#include <memory>
17#include <string>
18#include <utility>
19
20#include "baselib_export.h"
21
22namespace BaseLib
23{
24extern BASELIB_EXPORT std::shared_ptr<spdlog::logger> console;
25void setConsoleLogLevel(std::string const& level_string);
26void initOGSLogger(std::string const& log_level);
27} // namespace BaseLib
28
29template <typename... Args>
30void DBUG(fmt::format_string<Args...> fmt, Args&&... args)
31{
32 assert(BaseLib::console != nullptr);
33 BaseLib::console->debug(fmt, std::forward<Args>(args)...);
34}
35template <typename... Args>
36void INFO(fmt::format_string<Args...> fmt, Args&&... args)
37{
38 assert(BaseLib::console != nullptr);
39 BaseLib::console->info(fmt, std::forward<Args>(args)...);
40}
41template <typename... Args>
42void WARN(fmt::format_string<Args...> fmt, Args&&... args)
43{
44 assert(BaseLib::console != nullptr);
45 BaseLib::console->warn(fmt, std::forward<Args>(args)...);
46}
47template <typename... Args>
48void ERR(fmt::format_string<Args...> fmt, Args&&... args)
49{
50 assert(BaseLib::console != nullptr);
51 BaseLib::console->error(fmt, std::forward<Args>(args)...);
52}
53template <typename... Args>
54void CRITICAL(fmt::format_string<Args...> fmt, Args&&... args)
55{
56 assert(BaseLib::console != nullptr);
57 BaseLib::console->critical(fmt, std::forward<Args>(args)...);
58}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:36
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:48
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:42
void CRITICAL(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:54
#define BASELIB_EXPORT
void initOGSLogger(std::string const &log_level)
Definition Logging.cpp:64
void setConsoleLogLevel(std::string const &level_string)
Definition Logging.cpp:47
std::shared_ptr< spdlog::logger > console
Definition Logging.cpp:45
Definition AABB.h:288