From b0a7e3cf4a65ea95c79cf002596428d0aed2e26e Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Tue, 22 May 2007 23:30:15 +0000
Subject: [PATCH] Remove the dependence on AspectJ for all non method-entry and method-exit related debug messages. All debug statements will now work w/o weaving enabled. However, method-entry and method-exit debug messages work only with weaving enabled.
---
opends/src/server/org/opends/server/tools/LDAPModify.java | 35 ++++++++++++++++++++---------------
1 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/opends/src/server/org/opends/server/tools/LDAPModify.java b/opends/src/server/org/opends/server/tools/LDAPModify.java
index f103a20..a2bc7de 100644
--- a/opends/src/server/org/opends/server/tools/LDAPModify.java
+++ b/opends/src/server/org/opends/server/tools/LDAPModify.java
@@ -78,8 +78,8 @@
import org.opends.server.util.args.IntegerArgument;
import org.opends.server.util.args.StringArgument;
-import static org.opends.server.loggers.debug.DebugLogger.debugCaught;
-import static org.opends.server.loggers.debug.DebugLogger.debugEnabled;
+import static org.opends.server.loggers.debug.DebugLogger.*;
+import org.opends.server.loggers.debug.DebugTracer;
import static org.opends.server.messages.MessageHandler.*;
import static org.opends.server.messages.ToolMessages.*;
import static org.opends.server.protocols.ldap.LDAPResultCode.*;
@@ -96,6 +96,11 @@
public class LDAPModify
{
/**
+ * The tracer object for the debug logger.
+ */
+ private static final DebugTracer TRACER = getTracer();
+
+ /**
* The fully-qualified name of this class.
*/
private static final String CLASS_NAME = "org.opends.server.tools.LDAPModify";
@@ -168,7 +173,7 @@
{
if (debugEnabled())
{
- debugCaught(DebugLogLevel.ERROR, e);
+ TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
int msgID = MSGID_LDIF_FILE_CANNOT_OPEN_FOR_READ;
String message = getMessage(msgID, is, String.valueOf(e));
@@ -186,7 +191,7 @@
{
if (debugEnabled())
{
- debugCaught(DebugLogLevel.ERROR, le);
+ TRACER.debugCaught(DebugLogLevel.ERROR, le);
}
if (!modifyOptions.continueOnError())
{
@@ -198,7 +203,7 @@
{
if (debugEnabled())
{
- debugCaught(DebugLogLevel.ERROR, e);
+ TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
}
@@ -219,7 +224,7 @@
{
if (debugEnabled())
{
- debugCaught(DebugLogLevel.ERROR, e);
+ TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
if (!modifyOptions.continueOnError())
@@ -232,7 +237,7 @@
{
if (debugEnabled())
{
- debugCaught(DebugLogLevel.ERROR, e2);
+ TRACER.debugCaught(DebugLogLevel.ERROR, e2);
}
}
@@ -260,7 +265,7 @@
{
if (debugEnabled())
{
- debugCaught(DebugLogLevel.ERROR, e);
+ TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
}
@@ -345,7 +350,7 @@
{
if (debugEnabled())
{
- debugCaught(DebugLogLevel.ERROR, ae);
+ TRACER.debugCaught(DebugLogLevel.ERROR, ae);
}
msgID = MSGID_OPERATION_FAILED;
String message = getMessage(msgID, operationType);
@@ -883,7 +888,7 @@
{
if (debugEnabled())
{
- debugCaught(DebugLogLevel.ERROR, ae);
+ TRACER.debugCaught(DebugLogLevel.ERROR, ae);
}
err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH));
return 1;
@@ -903,7 +908,7 @@
{
if (debugEnabled())
{
- debugCaught(DebugLogLevel.ERROR, ae);
+ TRACER.debugCaught(DebugLogLevel.ERROR, ae);
}
err.println(wrapText(ae.getMessage(), MAX_LINE_WIDTH));
return 1;
@@ -924,7 +929,7 @@
{
if (debugEnabled())
{
- debugCaught(DebugLogLevel.ERROR, ex);
+ TRACER.debugCaught(DebugLogLevel.ERROR, ex);
}
err.println(wrapText(ex.getMessage(), MAX_LINE_WIDTH));
return 1;
@@ -1141,7 +1146,7 @@
{
if (debugEnabled())
{
- debugCaught(DebugLogLevel.ERROR, le);
+ TRACER.debugCaught(DebugLogLevel.ERROR, le);
}
LDAPToolUtils.printErrorMessage(err, le.getMessage(), le.getResultCode(),
le.getErrorMessage(), le.getMatchedDN());
@@ -1151,7 +1156,7 @@
{
if (debugEnabled())
{
- debugCaught(DebugLogLevel.ERROR, lce);
+ TRACER.debugCaught(DebugLogLevel.ERROR, lce);
}
LDAPToolUtils.printErrorMessage(err, lce.getMessage(),
lce.getResultCode(),
@@ -1163,7 +1168,7 @@
{
if (debugEnabled())
{
- debugCaught(DebugLogLevel.ERROR, e);
+ TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
err.println(wrapText(e.getMessage(), MAX_LINE_WIDTH));
return 1;
--
Gitblit v1.10.0