dan-s1 commented on code in PR #10546:
URL: https://github.com/apache/nifi/pull/10546#discussion_r2542668205


##########
nifi-extension-bundles/nifi-enrich-bundle/nifi-enrich-processors/src/main/java/org/apache/nifi/processors/AbstractEnrichIP.java:
##########
@@ -63,11 +66,31 @@ public abstract class AbstractEnrichIP extends 
AbstractProcessor {
             
.addValidator(StandardValidators.createAttributeExpressionLanguageValidator(AttributeExpression.ResultType.STRING))
             .build();
 
+    private static final Pattern LOG_LEVEL_PATTERN = 
Pattern.compile("^(?:INFO|DEBUG|WARN|ERROR)$");
+    private static final Validator LOG_LEVEL_VALIDATOR = (subject, input, 
context) -> {
+        if (!context.isExpressionLanguagePresent(input)) {

Review Comment:
   I am not sure that would work easily as the as the valid response on lines 
82-86 are returned for two cases:
   1. When the input contains expression language
   2. When the input matches the `LOG_LEVEL_PATTERN`
   
   If I would invert the logic as you suggested I would have to duplicate these 
lines.



-- 
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]

Reply via email to