You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2019/06/24 05:19:52 UTC

[GitHub] [logging-log4j2] remkop commented on a change in pull request #284: LOG4J2-2639 - Allow logging calls to be constructed using a builder pattern

remkop commented on a change in pull request #284: LOG4J2-2639 - Allow logging calls to be constructed using a builder pattern
URL: https://github.com/apache/logging-log4j2/pull/284#discussion_r296555077
 
 

 ##########
 File path: log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
 ##########
 @@ -2755,77 +2755,114 @@ public void warn(final String message, final Object p0, final Object p1, final O
      * @since 3.0
      */
     @Override
-    public  LogBuilder atTrace() {
+    public  LogBuilder trace() {
         if (isTraceEnabled()) {
-            return logBuilder.get().setLevel(Level.TRACE);
+            DefaultLogBuilder builder = logBuilder.get();
+            if (builder.isInUse()) {
+                return new DefaultLogBuilder(this);
 
 Review comment:
   Wouldn't we need to call `setLevel(Level.TRACE)` on `new DefaultLogBuilder(this)` before returning it?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services