|
|
|
@ -17,16 +17,14 @@ rotating_logger->set_level(spdlog::level::info); |
|
|
|
|
int writeLogFile1() { |
|
|
|
|
|
|
|
|
|
// 写入不同级别的日志信息
|
|
|
|
|
rotating_logger->track("This is an track message"); |
|
|
|
|
rotating_logger->debug("This is an debug message"); |
|
|
|
|
rotating_logger->info("This is an info message"); |
|
|
|
|
rotating_logger->warn("This is a warning"); |
|
|
|
|
rotating_logger->error("This is an error"); |
|
|
|
|
|
|
|
|
|
rotating_logger->track("This is an track message" + armsName); // error
|
|
|
|
|
rotating_logger->debug("This is an debug message %s, %s", username, orgName); // error
|
|
|
|
|
rotating_logger->info("This is an info message" + armsName); // error
|
|
|
|
|
rotating_logger->warn("This is a warning" + armsName); // error
|
|
|
|
|
rotating_logger->warn("This is a warning, {}", armsName); // error
|
|
|
|
|
rotating_logger->error("This is an error" + armsName); // error
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
@ -47,10 +45,9 @@ int writeLogFile2() { |
|
|
|
|
|
|
|
|
|
// 写入不同级别的日志信息
|
|
|
|
|
log4cpp::Category& myCat = log4cpp::Category::getInstance(std::string("MyCategory")); |
|
|
|
|
myCat.track("This is an track message" + armsName); // error
|
|
|
|
|
myCat.debug("This is an debug message %s, %s", username, orgName); // error
|
|
|
|
|
myCat.info("This is an info message" + armsName); // error
|
|
|
|
|
myCat.warn("This is a warning" + armsName); // error
|
|
|
|
|
myCat.warn("This is a warning, {}", armsName); // error
|
|
|
|
|
myCat.error("This is an error" + armsName); // error
|
|
|
|
|
|
|
|
|
|
delete layout; |
|
|
|
|