From 1d5d1a6a4a0a58d6bb4803527dacb6641c027816 Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Tue, 28 Jan 2014 13:34:12 +0000
Subject: [PATCH] Checkpoint commit for OPENDJ-1288 :    Migrate I18n and logging support to i18n framework and SLF4J

---
 opendj3-server-dev/src/server/org/opends/server/replication/service/CTHeartbeatPublisherThread.java |   29 ++++++++++-------------------
 1 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/replication/service/CTHeartbeatPublisherThread.java b/opendj3-server-dev/src/server/org/opends/server/replication/service/CTHeartbeatPublisherThread.java
index faeab2b..15a784b 100644
--- a/opendj3-server-dev/src/server/org/opends/server/replication/service/CTHeartbeatPublisherThread.java
+++ b/opendj3-server-dev/src/server/org/opends/server/replication/service/CTHeartbeatPublisherThread.java
@@ -22,23 +22,20 @@
  *
  *
  *      Copyright 2009 Sun Microsystems, Inc.
- *      Portions Copyright 2011-2013 ForgeRock AS
+ *      Portions Copyright 2011-2014 ForgeRock AS
  */
 package org.opends.server.replication.service;
 
 import java.io.IOException;
 
 import org.opends.server.api.DirectoryThread;
-import org.opends.server.loggers.debug.DebugTracer;
+import org.forgerock.i18n.slf4j.LocalizedLogger;
 import org.opends.server.replication.common.CSN;
 import org.opends.server.replication.protocol.ChangeTimeHeartbeatMsg;
 import org.opends.server.replication.protocol.Session;
-import org.opends.server.types.DebugLogLevel;
 import org.opends.server.util.StaticUtils;
 import org.opends.server.util.TimeThread;
 
-import static org.opends.server.loggers.debug.DebugLogger.*;
-
 /**
  * This thread publishes a {@link ChangeTimeHeartbeatMsg} on a given protocol
  * session at regular intervals when there are no other replication messages
@@ -48,10 +45,7 @@
  */
 public class CTHeartbeatPublisherThread extends DirectoryThread
 {
-  /**
-   * The tracer object for the debug logger.
-   */
-  private static final DebugTracer TRACER = getTracer();
+  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
 
   /**
    * The session on which heartbeats are to be sent.
@@ -95,9 +89,9 @@
   {
     try
     {
-      if (debugEnabled())
+      if (logger.isTraceEnabled())
       {
-        TRACER.debugInfo(getName() + " is starting, interval is %d",
+        logger.trace(getName() + " is starting, interval is %d",
                   heartbeatInterval);
       }
 
@@ -129,10 +123,7 @@
             catch (InterruptedException e)
             {
               // Server shutdown monitor may interrupt slow threads.
-              if (debugEnabled())
-              {
-                TRACER.debugCaught(DebugLogLevel.ERROR, e);
-              }
+              logger.traceException(e);
               shutdown = true;
             }
           }
@@ -141,17 +132,17 @@
     }
     catch (IOException e)
     {
-      if (debugEnabled())
+      if (logger.isTraceEnabled())
       {
-        TRACER.debugInfo(getName() + " could not send a heartbeat: "
+        logger.trace(getName() + " could not send a heartbeat: "
             + StaticUtils.stackTraceToSingleLineString(e));
       }
     }
     finally
     {
-      if (debugEnabled())
+      if (logger.isTraceEnabled())
       {
-        TRACER.debugInfo(getName() + " is exiting.");
+        logger.trace(getName() + " is exiting.");
       }
     }
   }

--
Gitblit v1.10.0