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/loggers/TimeLimitRotationPolicy.java |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/opends/src/server/org/opends/server/loggers/TimeLimitRotationPolicy.java b/opends/src/server/org/opends/server/loggers/TimeLimitRotationPolicy.java
index 7501deb..eed1593 100644
--- a/opends/src/server/org/opends/server/loggers/TimeLimitRotationPolicy.java
+++ b/opends/src/server/org/opends/server/loggers/TimeLimitRotationPolicy.java
@@ -31,6 +31,8 @@
 import org.opends.server.admin.server.ConfigurationChangeListener;
 import org.opends.server.types.ConfigChangeResult;
 import org.opends.server.types.ResultCode;
+import static org.opends.server.loggers.debug.DebugLogger.*;
+import org.opends.server.loggers.debug.DebugTracer;
 
 import java.util.List;
 import java.util.ArrayList;
@@ -43,6 +45,11 @@
     RotationPolicy<TimeLimitLogRotationPolicyCfg>,
     ConfigurationChangeListener<TimeLimitLogRotationPolicyCfg>
 {
+  /**
+   * The tracer object for the debug logger.
+   */
+  private static final DebugTracer TRACER = getTracer();
+
   private long timeInterval = 0;
 
   /**
@@ -92,7 +99,16 @@
   public boolean rotateFile(MultifileTextWriter writer)
   {
     long currTime = TimeThread.getTime();
-    return currTime - writer.getLastRotationTime() > timeInterval;
+    long currInterval = currTime - writer.getLastRotationTime();
+
+    if (debugEnabled())
+    {
+      TRACER.debugInfo("Last rotation occured %ds ago. " +
+          "Next rotation in %ds", currInterval / 1000,
+                                   (timeInterval - currInterval)/1000);
+    }
+
+    return currInterval > timeInterval;
   }
 
 }

--
Gitblit v1.10.0