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/api/VirtualAttributeProvider.java |   58 ++++++++++++----------------------------------------------
 1 files changed, 12 insertions(+), 46 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/api/VirtualAttributeProvider.java b/opendj3-server-dev/src/server/org/opends/server/api/VirtualAttributeProvider.java
index 48ca4b8..7e3c8bd 100644
--- a/opendj3-server-dev/src/server/org/opends/server/api/VirtualAttributeProvider.java
+++ b/opendj3-server-dev/src/server/org/opends/server/api/VirtualAttributeProvider.java
@@ -35,11 +35,10 @@
 import org.opends.server.admin.std.server.VirtualAttributeCfg;
 import org.opends.server.config.ConfigException;
 import org.opends.server.core.SearchOperation;
-import org.opends.server.loggers.debug.DebugTracer;
+import org.forgerock.i18n.slf4j.LocalizedLogger;
 import org.opends.server.types.*;
 import org.forgerock.opendj.ldap.ByteString;
 import org.forgerock.opendj.ldap.ByteSequence;
-import static org.opends.server.loggers.debug.DebugLogger.*;
 
 /**
  * This class defines the set of methods and structures that must be
@@ -57,10 +56,7 @@
 public abstract class VirtualAttributeProvider
        <T extends VirtualAttributeCfg>
 {
-  /**
-   * The tracer object for the debug logger.
-   */
-  private static final DebugTracer TRACER = getTracer();
+  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
 
   /**
    * Initializes this virtual attribute based on the information in
@@ -298,10 +294,7 @@
       }
       catch (Exception e)
       {
-        if (debugEnabled())
-        {
-          TRACER.debugCaught(DebugLogLevel.ERROR, e);
-        }
+        logger.traceException(e);
 
         // The substring couldn't be normalized.  We have to return
         // "undefined".
@@ -328,10 +321,7 @@
         }
         catch (Exception e)
         {
-          if (debugEnabled())
-          {
-            TRACER.debugCaught(DebugLogLevel.ERROR, e);
-          }
+          logger.traceException(e);
 
           // The substring couldn't be normalized.  We have to return
           // "undefined".
@@ -355,10 +345,7 @@
       }
       catch (Exception e)
       {
-        if (debugEnabled())
-        {
-          TRACER.debugCaught(DebugLogLevel.ERROR, e);
-        }
+        logger.traceException(e);
 
         // The substring couldn't be normalized.  We have to return
         // "undefined".
@@ -383,10 +370,7 @@
       }
       catch (Exception e)
       {
-        if (debugEnabled())
-        {
-          TRACER.debugCaught(DebugLogLevel.ERROR, e);
-        }
+        logger.traceException(e);
 
         // The value couldn't be normalized.  If we can't find a
         // definite match, then we should return "undefined".
@@ -434,10 +418,7 @@
     }
     catch (Exception e)
     {
-      if (debugEnabled())
-      {
-        TRACER.debugCaught(DebugLogLevel.ERROR, e);
-      }
+      logger.traceException(e);
 
       // We couldn't normalize the provided value.  We should return
       // "undefined".
@@ -459,10 +440,7 @@
       }
       catch (Exception e)
       {
-        if (debugEnabled())
-        {
-          TRACER.debugCaught(DebugLogLevel.ERROR, e);
-        }
+        logger.traceException(e);
 
         // We couldn't normalize one of the attribute values.  If we
         // can't find a definite match, then we should return
@@ -511,10 +489,7 @@
     }
     catch (Exception e)
     {
-      if (debugEnabled())
-      {
-        TRACER.debugCaught(DebugLogLevel.ERROR, e);
-      }
+      logger.traceException(e);
 
       // We couldn't normalize the provided value.  We should return
       // "undefined".
@@ -536,10 +511,7 @@
       }
       catch (Exception e)
       {
-        if (debugEnabled())
-        {
-          TRACER.debugCaught(DebugLogLevel.ERROR, e);
-        }
+        logger.traceException(e);
 
         // We couldn't normalize one of the attribute values.  If we
         // can't find a definite match, then we should return
@@ -588,10 +560,7 @@
     }
     catch (Exception e)
     {
-      if (debugEnabled())
-      {
-        TRACER.debugCaught(DebugLogLevel.ERROR, e);
-      }
+      logger.traceException(e);
 
       // We couldn't normalize the provided value.  We should return
       // "undefined".
@@ -611,10 +580,7 @@
       }
       catch (Exception e)
       {
-        if (debugEnabled())
-        {
-          TRACER.debugCaught(DebugLogLevel.ERROR, e);
-        }
+        logger.traceException(e);
 
         // We couldn't normalize one of the attribute values.  If we
         // can't find a definite match, then we should return

--
Gitblit v1.10.0