Log变颜色功能实现

This commit is contained in:
binbinnomoney 2024-07-26 23:02:56 +08:00
parent 94af1eaaea
commit 5e978069b6

View File

@ -39,7 +39,7 @@ namespace ILogTest
*/ */
// 设置 INFO 级别的日志格式为 // 设置 INFO 级别的日志格式为绿
defaultConf.set(el::Level::Info, defaultConf.set(el::Level::Info,
el::ConfigurationType::Format, el::ConfigurationType::Format,
"\x1b[32m%datetime %level %msg\x1b[0m"); "\x1b[32m%datetime %level %msg\x1b[0m");
@ -81,7 +81,7 @@ namespace ILogTest
// el::Loggers::reconfigureLogger("default", defaultConf); // el::Loggers::reconfigureLogger("default", defaultConf);
// 使用easylogging++的日志宏 // 使用easylogging++的日志宏
LOG(INFO) << "hello world......."; LOG(INFO) << "hello world.";
LOG(ERROR) << "create ... failed."; LOG(ERROR) << "create ... failed.";
LOG(DEBUG) << "a = " << 124 << " b = " << "apple"; LOG(DEBUG) << "a = " << 124 << " b = " << "apple";