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/schema/MatchingRuleSyntax.java |   43 +++++++++----------------------------------
 1 files changed, 9 insertions(+), 34 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/schema/MatchingRuleSyntax.java b/opendj3-server-dev/src/server/org/opends/server/schema/MatchingRuleSyntax.java
index 467e729..739ed85 100644
--- a/opendj3-server-dev/src/server/org/opends/server/schema/MatchingRuleSyntax.java
+++ b/opendj3-server-dev/src/server/org/opends/server/schema/MatchingRuleSyntax.java
@@ -45,8 +45,7 @@
 import org.opends.server.types.*;
 import org.forgerock.opendj.ldap.ByteSequence;
 import static org.opends.server.loggers.ErrorLogger.*;
-import static org.opends.server.loggers.debug.DebugLogger.*;
-import org.opends.server.loggers.debug.DebugTracer;
+import org.forgerock.i18n.slf4j.LocalizedLogger;
 import static org.opends.messages.SchemaMessages.*;
 import org.forgerock.i18n.LocalizableMessageBuilder;
 import static org.opends.server.schema.SchemaConstants.*;
@@ -62,10 +61,7 @@
 public class MatchingRuleSyntax
        extends AttributeSyntax<AttributeSyntaxCfg>
 {
-  /**
-   * The tracer object for the debug logger.
-   */
-  private static final DebugTracer TRACER = getTracer();
+  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
 
 
 
@@ -411,10 +407,7 @@
       }
       catch (DirectoryException de)
       {
-        if (debugEnabled())
-        {
-          TRACER.debugCaught(DebugLogLevel.ERROR, de);
-        }
+        logger.traceException(de);
 
         invalidReason.append(de.getMessageObject());
         return false;
@@ -454,10 +447,7 @@
           }
           catch (DirectoryException de)
           {
-            if (debugEnabled())
-            {
-              TRACER.debugCaught(DebugLogLevel.ERROR, de);
-            }
+            logger.traceException(de);
 
             invalidReason.append(de.getMessageObject());
             return false;
@@ -477,10 +467,7 @@
           }
           catch (DirectoryException de)
           {
-            if (debugEnabled())
-            {
-              TRACER.debugCaught(DebugLogLevel.ERROR, de);
-            }
+            logger.traceException(de);
 
             invalidReason.append(de.getMessageObject());
             return false;
@@ -514,10 +501,7 @@
               }
               catch (DirectoryException de)
               {
-                if (debugEnabled())
-                {
-                  TRACER.debugCaught(DebugLogLevel.ERROR, de);
-                }
+                logger.traceException(de);
 
                 invalidReason.append(de.getMessageObject());
                 return false;
@@ -548,10 +532,7 @@
         }
         catch (DirectoryException de)
         {
-          if (debugEnabled())
-          {
-            TRACER.debugCaught(DebugLogLevel.ERROR, de);
-          }
+          logger.traceException(de);
 
           invalidReason.append(de.getMessageObject());
           return false;
@@ -574,10 +555,7 @@
         }
         catch (DirectoryException de)
         {
-          if (debugEnabled())
-          {
-            TRACER.debugCaught(DebugLogLevel.ERROR, de);
-          }
+          logger.traceException(de);
 
           invalidReason.append(de.getMessageObject());
           return false;
@@ -611,10 +589,7 @@
         }
         catch (DirectoryException de)
         {
-          if (debugEnabled())
-          {
-            TRACER.debugCaught(DebugLogLevel.ERROR, de);
-          }
+          logger.traceException(de);
 
           invalidReason.append(de.getMessageObject());
           return false;

--
Gitblit v1.10.0