14 #include <spdlog/sinks/stdout_color_sinks.h>
15 #include <spdlog/spdlog.h>
29 std::shared_ptr<spdlog::logger>
console = spdlog::stdout_color_mt(
"ogs");
31 std::shared_ptr<spdlog::logger>
console = spdlog::stdout_color_st(
"ogs");
36 using namespace spdlog::level;
37 std::map<std::string, level_enum> string_to_log_level = {
38 {
"none", off}, {
"critical", critical}, {
"error", err}, {
"warn", warn},
39 {
"info", info}, {
"debug", debug}, {
"all", trace}};
41 auto const level = string_to_log_level.find(level_string);
42 if (level == string_to_log_level.end())
44 ERR(
"'{:s}' is not a valid log level!", level_string);
47 console->set_level(level->second);
48 spdlog::set_default_logger(
console);
void ERR(char const *fmt, Args const &... args)
std::shared_ptr< spdlog::logger > console
void setConsoleLogLevel(std::string const &level_string)