vy commented on code in PR #2515:
URL: https://github.com/apache/logging-log4j2/pull/2515#discussion_r1579473335
##########
log4j-api/src/main/java/org/apache/logging/log4j/status/StatusData.java:
##########
@@ -167,9 +167,9 @@ public Throwable getThrowable() {
@SuppressWarnings("DefaultCharset")
public String getFormattedStatus() {
final StringBuilder sb = new StringBuilder();
- final String formattedInstant =
- instantFormatter != null ? instantFormatter.format(instant) :
instant.toString();
- sb.append(formattedInstant);
+ // DateTimeFormatter.ISO_INSTANT is the default used in
instant.toString()
+ DateTimeFormatter formatterToUse = instantFormatter != null ?
instantFormatter : DateTimeFormatter.ISO_INSTANT;
+ formatterToUse.formatTo(instant, sb);
Review Comment:
```suggestion
// `DateTimeFormatter.ISO_INSTANT` is the default used in
`Instant#toString()`
DateTimeFormatter effectiveInstantFormatter =
instantFormatter != null ? instantFormatter :
DateTimeFormatter.ISO_INSTANT;
effectiveInstantFormatter.formatTo(instant, sb);
```
--
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]