ppkarwasz commented on code in PR #3789:
URL: https://github.com/apache/logging-log4j2/pull/3789#discussion_r2196829985


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java:
##########
@@ -109,40 +109,19 @@ private static String readPattern(@Nullable final 
String[] options) {
      * @since 2.25.0
      */
     static String decodeNamedPattern(final String pattern) {
-        // If legacy formatters are enabled, we need to produce output aimed 
for `FixedDateFormat` and `FastDateFormat`.

Review Comment:
   > > At the same time, it omits some helpful context — for example, why do we 
convert `ABSOLUTE_PERIOD` to `"HH:mm:ss.SSS"` instead of passing it directly to 
the legacy formatter?
   > 
   > The legacy formatter is, as its name implies, legacy, and it shall not be 
used. It has several bugs, still.
   
   What I wanted to explain is why we have to use:
   
   ```java
   return NamedInstantPattern.valueOf(pattern).getLegacyPattern();
   ```
   
   instead of a simpler:
   
   ```java
   return NamedInstantPattern.valueOf(pattern).name();
   ```
   
   > But, can we keep the existing details, without omission, please?
   
   Sure, although here it looks a little bit out of context. What do you think 
about adding it to `NamedInstantPattern#getLegacyPattern()`?



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

Reply via email to