ramanathan1504 commented on code in PR #4256:
URL: https://github.com/apache/logging-log4j2/pull/4256#discussion_r3923517946
##########
log4j-core-test/src/test/java/org/apache/logging/log4j/core/config/plugins/processor/PluginProcessorPublicSetterTest.java:
##########
@@ -154,17 +155,13 @@ void explicitNoteKindBehavesLikeDefault(final String
kindValue) {
}
@Test
- void invalidKindValueEmitsWarning() {
+ void invalidKindValueDoesNotEmitWarningByDefault() {
Review Comment:
Can this go back to asserting the warning is printed?
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/GraalVmProcessor.java:
##########
@@ -102,7 +102,7 @@ public synchronized void init(ProcessingEnvironment
processingEnv) {
GraalVmProcessor.class.getName(),
kindValue,
PluginProcessor.MIN_ALLOWED_MESSAGE_KIND_OPTION,
- Diagnostic.Kind.NOTE,
+ Diagnostic.Kind.ERROR,
Arrays.toString(Diagnostic.Kind.values())));
Review Comment:
This warning goes through the filter it is reporting on
```suggestion
processingEnv
.getMessager()
.printMessage(
Diagnostic.Kind.WARNING,
MESSAGE_PREFIX
+ String.format(
"%s: unrecognized value `%s`
for option `%s`, using default `%s`. Valid values: %s",
GraalVmProcessor.class.getName(),
kindValue,
PluginProcessor.MIN_ALLOWED_MESSAGE_KIND_OPTION,
Diagnostic.Kind.ERROR,
Arrays.toString(Diagnostic.Kind.values())));
```
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/PluginProcessor.java:
##########
@@ -114,7 +114,7 @@ public void init(final ProcessingEnvironment processingEnv)
{
PluginProcessor.class.getName(),
kindValue,
MIN_ALLOWED_MESSAGE_KIND_OPTION,
- Diagnostic.Kind.NOTE,
+ Diagnostic.Kind.ERROR,
Arrays.toString(Diagnostic.Kind.values())));
Review Comment:
Same here, a typo in the value prints nothing.
```suggestion
processingEnv
.getMessager()
.printMessage(
Diagnostic.Kind.WARNING,
MESSAGE_PREFIX
+ String.format(
"%s: unrecognized value `%s`
for option `%s`, using default `%s`. Valid values: %s",
PluginProcessor.class.getName(),
kindValue,
MIN_ALLOWED_MESSAGE_KIND_OPTION,
Diagnostic.Kind.ERROR,
Arrays.toString(Diagnostic.Kind.values())));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]