vy commented on code in PR #3469:
URL: https://github.com/apache/logging-log4j2/pull/3469#discussion_r1958798429
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/util/internal/instant/InstantPatternDynamicFormatter.java:
##########
@@ -239,7 +239,11 @@ private static List<PatternSequence> sequencePattern(final
String pattern) {
final PatternSequence sequence;
switch (c) {
case 's':
- sequence = new SecondPatternSequence(true, "", 0);
+ if (sequenceContent.length() == 2) {
+ sequence = new SecondPatternSequence(true, "", 0);
+ } else {
+ sequence = new
DynamicPatternSequence(sequenceContent);
+ }
Review Comment:
@ppkarwasz, in #3338, you wanted keep the garbage-free behavior for
subminute precision at the cost of increasing the complexity. I think we can
still adhere to your motivation by adding a `secondPaddingLength` argument to
`SecondPatternSequence::new` and updating
`SecondPatternSequence::formatSeconds` accordingly. I am not keen on creating
an exception for second patterns that are not padded. WDYT?
--
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]