mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 01:51:38 +08:00
renamed setColor
This commit is contained in:
parent
ddc9aa8bdf
commit
d405027fe9
@ -113,7 +113,7 @@ void color_example()
|
|||||||
auto color_sink = std::make_shared<spd::sinks::ansicolor_sink>(console_out); // wraps around another sink
|
auto color_sink = std::make_shared<spd::sinks::ansicolor_sink>(console_out); // wraps around another sink
|
||||||
auto color_logger = spd::details::registry::instance().create("Color", color_sink);
|
auto color_logger = spd::details::registry::instance().create("Color", color_sink);
|
||||||
color_logger->set_level(spd::level::trace);
|
color_logger->set_level(spd::level::trace);
|
||||||
color_sink->setColor(spd::level::info, color_sink->bold + color_sink->green);
|
color_sink->set_color(spd::level::info, color_sink->bold + color_sink->green);
|
||||||
color_logger->info("Testing color logger...");
|
color_logger->info("Testing color logger...");
|
||||||
color_logger->trace("Trace");
|
color_logger->trace("Trace");
|
||||||
color_logger->debug("Debug");
|
color_logger->debug("Debug");
|
||||||
|
@ -30,7 +30,7 @@ public:
|
|||||||
virtual void log(const details::log_msg& msg) override;
|
virtual void log(const details::log_msg& msg) override;
|
||||||
virtual void flush() override;
|
virtual void flush() override;
|
||||||
|
|
||||||
void setColor(level::level_enum level, const std::string& color);
|
void set_color(level::level_enum level, const std::string& color);
|
||||||
|
|
||||||
/// \name Formatting codes
|
/// \name Formatting codes
|
||||||
//@{
|
//@{
|
||||||
@ -124,7 +124,7 @@ inline void ansicolor_sink::flush()
|
|||||||
sink_->flush();
|
sink_->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void ansicolor_sink::setColor(level::level_enum level, const std::string& color)
|
inline void ansicolor_sink::set_color(level::level_enum level, const std::string& color)
|
||||||
{
|
{
|
||||||
colors_[level] = color;
|
colors_[level] = color;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user