11#include <spdlog/common.h>
12#include <spdlog/sinks/stdout_color_sinks.h>
13#include <spdlog/spdlog.h>
17std::shared_ptr<spdlog::logger> get_logger(LoggerType logger_type) {
19 const char *logger_name = logger_type == LoggerType::OUT ?
"dlinear_out" :
"dlinear_err";
20 std::shared_ptr<spdlog::logger> logger{spdlog::get(logger_name)};
21 if (logger)
return logger;
24 logger = logger_type == LoggerType::OUT ? spdlog::stdout_color_mt(logger_name) : spdlog::stderr_color_mt(logger_name);
27 logger->set_level(spdlog::level::off);
30 logger->set_pattern(
"[%Y-%m-%d %H:%M:%S.%e] [%^%l%$] [thread %t] %v");
Global namespace for the dlinear library.