mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
ansicolor sink improvments (remove warning and uneeded string concat)
This commit is contained in:
parent
a2061e3780
commit
487c318788
@ -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<level::level_enum, std::string> 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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user