一个带有颜色的日志组件头文件
日志等级设置
一共设置了五个日志等级,分别是
- INFO
- DEBUG
- WARNING
- ERROR
- FATAL
效果
#include "log.hpp"
void test_log() {
LOG(INFO) << "here is the INFO text" << std::endl;
LOG(DEBUG) << "here is the DEBUG text" << std::endl;
LOG(WARNING) << "here is the WARNING text" << std::endl;
LOG(ERROR) << "here is the ERROR text" << std::endl;
LOG(FATAL) << "here is the FATAL text" << std::endl;
}
int main() {
test_log