Do not use Stopwatch.toString() in logging 89/36889/3
authorRobert Varga <rovarga@cisco.com>
Wed, 30 Mar 2016 14:05:29 +0000 (16:05 +0200)
committerRobert Varga <rovarga@cisco.com>
Thu, 31 Mar 2016 08:22:23 +0000 (10:22 +0200)
This prevents a conversion if the log level is not active.

Change-Id: Ia176a61c50929d500a5e041dd59d39c12a445f62
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorLeadershipTransferCohort.java

index 2916867..85980e2 100644 (file)
@@ -159,10 +159,9 @@ public class RaftActorLeadershipTransferCohort {
             transferTimer.stop();
             if(success) {
                 LOG.info("{}: Successfully transferred leadership to {} in {}", raftActor.persistenceId(),
-                        raftActor.getLeaderId(), transferTimer.toString());
+                        raftActor.getLeaderId(), transferTimer);
             } else {
-                LOG.warn("{}: Failed to transfer leadership in {}", raftActor.persistenceId(),
-                        transferTimer.toString());
+                LOG.warn("{}: Failed to transfer leadership in {}", raftActor.persistenceId(), transferTimer);
             }
         }