OGS
Logging.h
Go to the documentation of this file.
1
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 BaseLib::console->debug(fmt, std::forward<Args>(args)...);
33}
34template <typename... Args>
35void INFO(fmt::format_string<Args...> fmt, Args&&... args)
36{
37 BaseLib::console->info(fmt, std::forward<Args>(args)...);
38}
39template <typename... Args>
40void WARN(fmt::format_string<Args...> fmt, Args&&... args)
41{
42 BaseLib::console->warn(fmt, std::forward<Args>(args)...);
43}
44template <typename... Args>
45void ERR(fmt::format_string<Args...> fmt, Args&&... args)
46{
47 BaseLib::console->error(fmt, std::forward<Args>(args)...);
48}
49template <typename... Args>
50void CRITICAL(fmt::format_string<Args...> fmt, Args&&... args)
51{
52 BaseLib::console->critical(fmt, std::forward<Args>(args)...);
53}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:35
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:45
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40
void CRITICAL(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:50
#define BASELIB_EXPORT
void initOGSLogger(std::string const &log_level)
Definition Logging.cpp:54
void setConsoleLogLevel(std::string const &level_string)
Definition Logging.cpp:37
std::shared_ptr< spdlog::logger > console
Definition Logging.cpp:32
Definition AABB.h:288