IJPF-CR-21702 [java-inspection] IDEA-337700 Improvements for logging inspections

- fix text

GitOrigin-RevId: 18aaedbc0531f144ee819d22047d33a925ee9357
This commit is contained in:
Mikhail Pyltsin
2024-07-02 17:55:16 +02:00
committed by intellij-monorepo-bot
parent b4aa55737a
commit b88d49eb4c
3 changed files with 23 additions and 23 deletions

View File

@@ -12,7 +12,7 @@ class JavaLoggingStatementNotGuardedByLogConditionInspectionTest : LoggingStatem
class X {
private static final Logger LOG = LoggerFactory.getLogger(X.class);
void n(String arg) {
<warning descr="Logging call not guarded by log condition">LOG.debug("test" + arg)</warning>;
<warning descr="Logging call not guarded by a logging condition">LOG.debug("test" + arg)</warning>;
}
}
""".trimIndent())
@@ -38,7 +38,7 @@ class JavaLoggingStatementNotGuardedByLogConditionInspectionTest : LoggingStatem
class X {
static final Logger LOG = LogManager.getLogger();
void n(String arg) {
<warning descr="Logging call not guarded by log condition">LOG.debug("test" + arg)</warning>;
<warning descr="Logging call not guarded by a logging condition">LOG.debug("test" + arg)</warning>;
}
}
""".trimIndent())
@@ -81,7 +81,7 @@ class JavaLoggingStatementNotGuardedByLogConditionInspectionTest : LoggingStatem
}
if(LOG.isInfoEnabled()) {
<warning descr="Logging call not guarded by log condition">LOG.debug("test" + arg)</warning>; //todo!
<warning descr="Logging call not guarded by a logging condition">LOG.debug("test" + arg)</warning>; //todo!
}
if(true && LOG.isDebugEnabled()) {
@@ -96,7 +96,7 @@ class JavaLoggingStatementNotGuardedByLogConditionInspectionTest : LoggingStatem
if(true) {
if(true) {
<warning descr="Logging call not guarded by log condition">LOG.debug("test" + arg)</warning>;
<warning descr="Logging call not guarded by a logging condition">LOG.debug("test" + arg)</warning>;
}
}
}
@@ -143,10 +143,10 @@ class JavaLoggingStatementNotGuardedByLogConditionInspectionTest : LoggingStatem
class X {
private static final Logger LOG = LoggerFactory.getLogger(X.class);
void n1(String arg) {
<warning descr="Logging call not guarded by log condition">LOG.debug("test")</warning>;
<warning descr="Logging call not guarded by a logging condition">LOG.debug("test")</warning>;
}
void n2(String arg) {
<warning descr="Logging call not guarded by log condition">LOG.debug("test")</warning>;
<warning descr="Logging call not guarded by a logging condition">LOG.debug("test")</warning>;
}
}
""".trimIndent())
@@ -159,28 +159,28 @@ class JavaLoggingStatementNotGuardedByLogConditionInspectionTest : LoggingStatem
class X {
private static final Logger LOG = LoggerFactory.getLogger(X.class);
void n2(String arg) {
<warning descr="Logging call not guarded by log condition">LOG.debug("test1" + arg)</warning>;
<warning descr="Logging call not guarded by a logging condition">LOG.debug("test1" + arg)</warning>;
LOG.debug("test2" + arg);
}
void n3(String arg) {
<warning descr="Logging call not guarded by log condition">LOG.debug("test1" + arg)</warning>;
<warning descr="Logging call not guarded by a logging condition">LOG.debug("test1" + arg)</warning>;
LOG.debug("test2" + arg);
LOG.debug("test2" + arg);
}
void constantCall(String arg) {
LOG.debug("test1");
<warning descr="Logging call not guarded by log condition">LOG.debug("test2" + arg)</warning>;
<warning descr="Logging call not guarded by a logging condition">LOG.debug("test2" + arg)</warning>;
}
void beforeNotLog(String arg) {
constantCall(arg);
<warning descr="Logging call not guarded by log condition">LOG.debug("test2" + arg)</warning>;
<warning descr="Logging call not guarded by a logging condition">LOG.debug("test2" + arg)</warning>;
}
void differentLevels(String arg) {
<warning descr="Logging call not guarded by log condition">LOG.debug("test1" + arg)</warning>;
<warning descr="Logging call not guarded by a logging condition">LOG.debug("test1" + arg)</warning>;
LOG.warn("test2" + arg);
}
}