From 4783adc14c2d6b96260052d3b634eafa500c6ddf Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Thu, 01 Mar 2007 03:27:06 +0000
Subject: [PATCH] This removes old debug logging framework method calls that are going to be automatically instrumented by AspectJ. Non instrumented debug method calls are updated to use the new debug framework methods. However, the new debug logging framework is not yet active as the Aspects are not weaved in. After this revision, debug logging will be disabled in the server until the new AOP framework is complete. 

---
 opendj-sdk/opends/src/server/org/opends/server/tools/LDAPConnection.java |   39 +++++++++++++++++++++++++++------------
 1 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPConnection.java b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPConnection.java
index b4897e1..4e8bd5c 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPConnection.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPConnection.java
@@ -46,8 +46,10 @@
 import org.opends.server.protocols.ldap.LDAPControl;
 import org.opends.server.protocols.ldap.LDAPMessage;
 import org.opends.server.types.Control;
+import org.opends.server.types.DebugLogLevel;
 
-import static org.opends.server.loggers.Debug.*;
+import static org.opends.server.loggers.debug.DebugLogger.debugCought;
+import static org.opends.server.loggers.debug.DebugLogger.debugEnabled;
 import static org.opends.server.messages.MessageHandler.*;
 import static org.opends.server.messages.CoreMessages.
                    MSGID_RESULT_CLIENT_SIDE_CONNECT_ERROR;
@@ -64,11 +66,6 @@
  */
 public class LDAPConnection
 {
-  /**
-   * The fully-qualified name of this class for debugging purposes.
-   */
-  private static final String CLASS_NAME =
-       "org.opends.server.tools.LDAPConnection";
 
   // The hostname to connect to.
   private String hostName = null;
@@ -176,7 +173,10 @@
         throw new LDAPConnectionException(msg, CLIENT_SIDE_CONNECT_ERROR, ce);
       } catch(Exception ex)
       {
-        assert debugException(CLASS_NAME, "connectToHost", ex);
+        if (debugEnabled())
+        {
+          debugCought(DebugLogLevel.ERROR, ex);
+        }
         throw new LDAPConnectionException(ex.getMessage(), ex);
       }
 
@@ -194,7 +194,10 @@
         msg = LDAPMessage.decode(asn1Reader.readElement().decodeAsSequence());
       } catch (Exception ex1)
       {
-        assert debugException(CLASS_NAME, "connectToHost", ex1);
+        if (debugEnabled())
+        {
+          debugCought(DebugLogLevel.ERROR, ex1);
+        }
         throw new LDAPConnectionException(ex1.getMessage(), ex1);
       }
       ExtendedResponseProtocolOp res = msg.getExtendedResponseProtocolOp();
@@ -242,7 +245,10 @@
       throw new LDAPConnectionException(msg, CLIENT_SIDE_CONNECT_ERROR, ce);
     } catch(Exception ex2)
     {
-      assert debugException(CLASS_NAME, "connectToHost", ex2);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, ex2);
+      }
       throw new LDAPConnectionException(ex2.getMessage(), ex2);
     }
 
@@ -254,7 +260,10 @@
       socket.setReuseAddress(true);
     } catch(IOException e)
     {
-      assert debugException(CLASS_NAME, "connectToHost", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
       // It doesn't matter too much if this throws, so ignore it.
     }
 
@@ -392,11 +401,17 @@
       }
     } catch(ClientException ce)
     {
-      assert debugException(CLASS_NAME, "connectToHost", ce);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, ce);
+      }
       throw new LDAPConnectionException(ce.getMessage(), ce.getExitCode(), ce);
     } catch(Exception ex)
     {
-      assert debugException(CLASS_NAME, "connectToHost", ex);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, ex);
+      }
       throw new LDAPConnectionException(ex.getMessage(), ex);
     }
 

--
Gitblit v1.10.0