From 8abaa0b38378e981df13bd5e765e05639a8d2984 Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 6 Dec 2024 15:06:18 +0200 Subject: [PATCH] Clean context ctor --- src/details/context.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/details/context.cpp b/src/details/context.cpp index de707c42..a4137cd8 100644 --- a/src/details/context.cpp +++ b/src/details/context.cpp @@ -5,12 +5,7 @@ #include "spdlog/logger.h" #ifndef SPDLOG_DISABLE_GLOBAL_LOGGER - // support for the global stdout color logger - #ifdef _WIN32 - #include "spdlog/sinks/wincolor_sink.h" - #else - #include "spdlog/sinks/ansicolor_sink.h" - #endif +#include "spdlog/sinks/stdout_color_sinks.h" #endif // SPDLOG_DISABLE_GLOBAL_LOGGER #include @@ -20,15 +15,8 @@ namespace details { context::context() { #ifndef SPDLOG_DISABLE_GLOBAL_LOGGER - // create global logger (ansicolor_stdout_sink_mt or wincolor_stdout_sink_mt in windows). - #ifdef _WIN32 - auto color_sink = std::make_shared(); - #else - auto color_sink = std::make_shared(); - #endif - const char *global_logger_name = ""; - global_logger_ = std::make_shared(global_logger_name, std::move(color_sink)); - + auto color_sink = std::make_shared(); + global_logger_ = std::make_shared(std::string(), std::move(color_sink)); #endif // SPDLOG_DISABLE_GLOBAL_LOGGER }