ppkarwasz commented on code in PR #3338: URL: https://github.com/apache/logging-log4j2/pull/3338#discussion_r1898979284
########## 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); Review Comment: I planned to use the `BiFunction` parameter to test different sequencing algorithms, but didn't go through with it. Fixed in https://github.com/apache/logging-log4j2/pull/3338/commits/148315830d367772c0d89d405be064e92045549f. -- 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