mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 10:01:33 +08:00
Update README.md
This commit is contained in:
parent
bcc1918da1
commit
0d97696f78
12
README.md
12
README.md
@ -134,12 +134,12 @@ int main(int, char* [])
|
||||
syslog_logger->warn("This is warning that will end up in syslog. This is Linux only!");
|
||||
#endif
|
||||
|
||||
//console color example
|
||||
auto console_out = spdlog::sinks::stderr_sink_st::instance();
|
||||
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);
|
||||
color_sink->set_color(spd::level::info, color_sink->bold + color_sink->green);
|
||||
color_logger->info("Testing color logger...");
|
||||
//colored console sink example
|
||||
auto console_out = spdlog::sinks::stderr_sink_st::instance();
|
||||
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);
|
||||
color_sink->set_color(spd::level::info, color_sink->bold + color_sink->green);
|
||||
color_logger->info("Testing color logger...");
|
||||
}
|
||||
catch (const spd::spdlog_ex& ex)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user