From f7dcad8374445803e6d62deb4ec7f2f17f290a41 Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 9 Nov 2024 14:22:29 +0200 Subject: [PATCH] use set_color_mode_ in ctor --- include/spdlog/sinks/ansicolor_sink-inl.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/spdlog/sinks/ansicolor_sink-inl.h b/include/spdlog/sinks/ansicolor_sink-inl.h index 8d85edc2..b2b3e604 100644 --- a/include/spdlog/sinks/ansicolor_sink-inl.h +++ b/include/spdlog/sinks/ansicolor_sink-inl.h @@ -79,14 +79,13 @@ SPDLOG_INLINE void ansicolor_sink::set_color_mode_(color_mode mode) { switch (mode) { case color_mode::always: should_do_colors_ = true; - return; + return; case color_mode::automatic: - should_do_colors_ = - details::os::in_terminal(target_file_) && details::os::is_color_terminal(); - return; + should_do_colors_ = details::os::in_terminal(target_file_) && details::os::is_color_terminal(); + return; case color_mode::never: should_do_colors_ = false; - return; + return; default: should_do_colors_ = false; }