From 455897cc245b67d929f409a93cfa7106e835cc1f 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.
---
opends/src/server/org/opends/server/loggers/FixedTimeRotationPolicy.java | 25 ++++++++++++-------------
1 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/opends/src/server/org/opends/server/loggers/FixedTimeRotationPolicy.java b/opends/src/server/org/opends/server/loggers/FixedTimeRotationPolicy.java
index 4dc3d21..0ca8b42 100644
--- a/opends/src/server/org/opends/server/loggers/FixedTimeRotationPolicy.java
+++ b/opends/src/server/org/opends/server/loggers/FixedTimeRotationPolicy.java
@@ -22,18 +22,17 @@
* CDDL HEADER END
*
*
- * Portions Copyright 2006 Sun Microsystems, Inc.
+ * Portions Copyright 2006-2007 Sun Microsystems, Inc.
*/
package org.opends.server.loggers;
import java.util.Calendar;
import java.util.GregorianCalendar;
-import org.opends.server.types.DebugLogCategory;
-import org.opends.server.types.DebugLogSeverity;
import org.opends.server.util.TimeThread;
-import static org.opends.server.loggers.Debug.*;
+import static org.opends.server.loggers.debug.DebugLogger.debugEnabled;
+import static org.opends.server.loggers.debug.DebugLogger.debugInfo;
/**
* This class implements a rotation policy based on fixed
@@ -41,8 +40,6 @@
*/
public class FixedTimeRotationPolicy implements RotationPolicy
{
- private static final String CLASS_NAME =
- "org.opends.server.loggers.FixedTimeRotationPolicy";
private static final long NEXT_DAY = 24 * 3600 * 1000;
@@ -58,7 +55,6 @@
public FixedTimeRotationPolicy(int[] timeOfDays)
{
- assert debugConstructor(CLASS_NAME, String.valueOf(timeOfDays));
Calendar cal = new GregorianCalendar();
cal.set( Calendar.MILLISECOND, 0 );
@@ -91,18 +87,21 @@
*/
public boolean rotateFile()
{
- assert debugEnter(CLASS_NAME, "rotateFile");
long currTime = TimeThread.getTime();
- assert debugMessage(DebugLogCategory.CORE_SERVER,
- DebugLogSeverity.INFO, CLASS_NAME, "rotateFile",
- "Rotation at fixed time:" + currTime +
- " nextRotationTime:" + nextRotationTime);
+ if (debugEnabled())
+ {
+ debugInfo("Rotation at fixed time: %d nextRotationTime: %d",
+ currTime, nextRotationTime);
+ }
if(currTime > nextRotationTime)
{
nextRotationTime = getNextRotationTime(currTime, nextRotationTime);
- //System.out.println("Setting next rotation time to:" + nextRotationTime);
+ if (debugEnabled())
+ {
+ debugInfo("Setting next rotation to : %d", nextRotationTime);
+ }
return true;
}
return false;
--
Gitblit v1.10.0