ppkarwasz commented on code in PR #3338: URL: https://github.com/apache/logging-log4j2/pull/3338#discussion_r1898975890
########## log4j-core/src/main/java/org/apache/logging/log4j/core/util/internal/instant/InstantPatternDynamicFormatter.java: ########## @@ -218,17 +222,27 @@ public void formatTo(final StringBuilder buffer, final Instant instant) { } } - static List<PatternSequence> sequencePattern(final String pattern, final ChronoUnit precisionThreshold) { - List<PatternSequence> sequences = sequencePattern(pattern); - final List<PatternSequence> mergedSequences = mergeDynamicSequences(sequences, precisionThreshold); - return mergeConsequentEffectivelyConstantSequences(mergedSequences, precisionThreshold); + static List<PatternFormatterFactory> sequencePattern(final String pattern, final ChronoUnit precisionThreshold) { + List<PatternFormatterFactory> sequences = sequencePattern(pattern, (l, p) -> { + switch (l) { + case 's': + return new SecondPatternFormatterFactory(true, "", 0); + case 'S': + return new SecondPatternFormatterFactory(false, "", p.length()); + default: + return new DateTimeFormatterPatternFormatterFactory(p); + } + }); + return mergeFactories(sequences, precisionThreshold); } - private static List<PatternSequence> sequencePattern(final String pattern) { + static List<PatternFormatterFactory> sequencePattern( Review Comment: Fixed in https://github.com/apache/logging-log4j2/pull/3338/commits/7879316ab6c81fdb7cb676ac3dfdeed906a832fe. -- 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: notifications-unsubscr...@logging.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org