From 9c954f1411d833f43c98ad3bc607c4ec4f07aaf5 Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Fri, 08 Jun 2007 18:50:35 +0000
Subject: [PATCH] Fixed an issue where the error log doesn't actually log messages. Also improved the performance of the loggers when they are disabled.

---
 opends/src/server/org/opends/server/loggers/TextAuditLogPublisher.java |   53 ++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/opends/src/server/org/opends/server/loggers/TextAuditLogPublisher.java b/opends/src/server/org/opends/server/loggers/TextAuditLogPublisher.java
index 612944f..aa85bab 100644
--- a/opends/src/server/org/opends/server/loggers/TextAuditLogPublisher.java
+++ b/opends/src/server/org/opends/server/loggers/TextAuditLogPublisher.java
@@ -819,16 +819,16 @@
    */
   private void encodeValue(ByteString str, StringBuilder buffer)
   {
-      byte[] byteVal = str.value();
-      if(StaticUtils.needsBase64Encoding(byteVal))
-      {
-        buffer.append(": ");
-        buffer.append(Base64.encode(byteVal));
-      } else
-      {
-        buffer.append(" ");
-        str.toString(buffer);
-      }
+    byte[] byteVal = str.value();
+    if(StaticUtils.needsBase64Encoding(byteVal))
+    {
+      buffer.append(": ");
+      buffer.append(Base64.encode(byteVal));
+    } else
+    {
+      buffer.append(" ");
+      str.toString(buffer);
+    }
   }
 
 
@@ -841,15 +841,30 @@
    */
   private void encodeValue(String str, StringBuilder buffer)
   {
-      if(StaticUtils.needsBase64Encoding(str))
-      {
-        buffer.append(": ");
-        buffer.append(Base64.encode(getBytes(str)));
-      } else
-      {
-        buffer.append(" ");
-        buffer.append(str);
-      }
+    if(StaticUtils.needsBase64Encoding(str))
+    {
+      buffer.append(": ");
+      buffer.append(Base64.encode(getBytes(str)));
+    } else
+    {
+      buffer.append(" ");
+      buffer.append(str);
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public DN getDN()
+  {
+    if(currentConfig != null)
+    {
+      return currentConfig.dn();
+    }
+    else
+    {
+      return null;
+    }
   }
 }
 

--
Gitblit v1.10.0