You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ratis.apache.org by sz...@apache.org on 2019/12/05 20:49:53 UTC

[incubator-ratis] branch master updated: RATIS-768. LogUtils#infoOrTrace prints exception trace at both levels. Contributed by Attila Doroszlai

This is an automated email from the ASF dual-hosted git repository.

szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ratis.git


The following commit(s) were added to refs/heads/master by this push:
     new 1402eb8  RATIS-768. LogUtils#infoOrTrace prints exception trace at both levels.  Contributed by Attila Doroszlai
1402eb8 is described below

commit 1402eb81dbd3f5ab388d9b9bab63c235a0ee190d
Author: Tsz Wo Nicholas Sze <sz...@apache.org>
AuthorDate: Thu Dec 5 12:49:10 2019 -0800

    RATIS-768. LogUtils#infoOrTrace prints exception trace at both levels.  Contributed by Attila Doroszlai
---
 ratis-common/src/main/java/org/apache/ratis/util/LogUtils.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ratis-common/src/main/java/org/apache/ratis/util/LogUtils.java b/ratis-common/src/main/java/org/apache/ratis/util/LogUtils.java
index 7adba68..eb05ae1 100644
--- a/ratis-common/src/main/java/org/apache/ratis/util/LogUtils.java
+++ b/ratis-common/src/main/java/org/apache/ratis/util/LogUtils.java
@@ -133,8 +133,8 @@ public interface LogUtils {
   static void infoOrTrace(Logger log, Supplier<String> message, Throwable t) {
     if (log.isTraceEnabled()) {
       log.trace(message.get(), t);
-    } else {
-      log.info("{}: {}", message.get(), t);
+    } else if (log.isInfoEnabled()) {
+      log.info("{}: {}", message.get(), String.valueOf(t));
     }
   }
 }