From 753fbddae6047d960a26445976ae75c0adfdc4d5 Mon Sep 17 00:00:00 2001 From: Guo XIn <371864209@qq.com> Date: Wed, 17 Jan 2024 10:19:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A2=AB=E6=B5=8B=E4=BB=B6?= =?UTF-8?q?=EF=BC=9A=E6=85=8E=E9=87=8D=E8=80=83=E8=99=91=E5=86=99=E5=85=A5?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=96=87=E4=BB=B6=E4=BF=A1=E6=81=AF=E7=9A=84?= =?UTF-8?q?=E9=9A=90=E7=A7=81=E6=80=A7=E3=80=82=E9=81=BF=E5=85=8D=E6=8A=8A?= =?UTF-8?q?=E6=95=8F=E6=84=9F=E4=BF=A1=E6=81=AF=E5=86=99=E5=85=A5=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sonar/cxx/rules/checkers/LogFileWriteChecker.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sonar-keyware-plugins-cxx/src/test/resources/com/keyware/sonar/cxx/rules/checkers/LogFileWriteChecker.cc b/sonar-keyware-plugins-cxx/src/test/resources/com/keyware/sonar/cxx/rules/checkers/LogFileWriteChecker.cc index 0626055..c889a40 100644 --- a/sonar-keyware-plugins-cxx/src/test/resources/com/keyware/sonar/cxx/rules/checkers/LogFileWriteChecker.cc +++ b/sonar-keyware-plugins-cxx/src/test/resources/com/keyware/sonar/cxx/rules/checkers/LogFileWriteChecker.cc @@ -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;