From 487c3187887dd8cbaff710481b614b6fa0a172a8 Mon Sep 17 00:00:00 2001 From: gabime Date: Wed, 30 Mar 2016 19:34:40 +0300 Subject: [PATCH] ansicolor sink improvments (remove warning and uneeded string concat) --- include/spdlog/sinks/ansicolor_sink.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/spdlog/sinks/ansicolor_sink.h b/include/spdlog/sinks/ansicolor_sink.h index 0b79990b..a256f3b8 100644 --- a/include/spdlog/sinks/ansicolor_sink.h +++ b/include/spdlog/sinks/ansicolor_sink.h @@ -21,7 +21,7 @@ namespace sinks { */ class ansicolor_sink : public sink { public: - ansicolor_sink(sink_ptr sink); + ansicolor_sink(sink_ptr wrapped_sink); virtual ~ansicolor_sink(); ansicolor_sink(const ansicolor_sink& other); @@ -73,7 +73,7 @@ protected: std::map colors_; }; -inline ansicolor_sink::ansicolor_sink(sink_ptr sink) : sink_(sink) +inline ansicolor_sink::ansicolor_sink(sink_ptr wrapped_sink) : sink_(wrapped_sink) { colors_[level::trace] = white; colors_[level::debug] = white; @@ -115,7 +115,7 @@ inline void ansicolor_sink::log(const details::log_msg& msg) const std::string s = msg.formatted.str(); const std::string suffix = reset; details::log_msg m; - m.formatted.write(prefix + s + suffix); + m.formatted << prefix << s << suffix; sink_->log(m); }