diff --git a/include/spdlog/details/traits.h b/include/spdlog/details/traits.h index 6ce2cb27..d494cf73 100644 --- a/include/spdlog/details/traits.h +++ b/include/spdlog/details/traits.h @@ -25,7 +25,7 @@ struct console_stderr_trait { static FILE *stream() { - return stdout; + return stderr; } #ifdef _WIN32 static HANDLE handle() diff --git a/include/spdlog/sinks/ansicolor_sink.h b/include/spdlog/sinks/ansicolor_sink.h index 22192889..06e1867a 100644 --- a/include/spdlog/sinks/ansicolor_sink.h +++ b/include/spdlog/sinks/ansicolor_sink.h @@ -22,13 +22,13 @@ namespace sinks { * of the message. * If no color terminal detected, omit the escape codes. */ -template +template class ansicolor_sink : public sink { public: using mutex_t = typename ConsoleMutexTrait::mutex_t; ansicolor_sink() - : target_file_(ConsoleTargetTrait::stream()) + : target_file_(StreamTrait::stream()) , _mutex(ConsoleMutexTrait::console_mutex()) {