ppkarwasz commented on code in PR #2667:
URL: https://github.com/apache/logging-log4j2/pull/2667#discussion_r1644103084
##########
log4j-layout-template-json/src/main/java/org/apache/logging/log4j/layout/template/json/resolver/PatternResolver.java:
##########
@@ -71,6 +70,16 @@ public final class PatternResolver implements EventResolver {
patternLayout.serialize(logEvent, stringBuilder);
}
+ private static String readPattern(
+ final EventResolverStringSubstitutor substitutor, final
TemplateResolverConfig config) {
+ final String pattern = config.getString("pattern");
+ if (Strings.isBlank(pattern)) {
+ throw new IllegalArgumentException("blank pattern: " + config);
+ }
+ final boolean substitutionNeeded = pattern.contains("${");
+ return substitutionNeeded ? substitutor.replace(null, pattern) :
pattern;
Review Comment:
Do we need this logic?
Seems like premature optimization to me.
--
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]