You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2012/10/08 16:50:06 UTC

svn commit: r1395592 - /directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java

Author: elecharny
Date: Mon Oct  8 14:50:06 2012
New Revision: 1395592

URL: http://svn.apache.org/viewvc?rev=1395592&view=rev
Log:
Added some speed up for logs

Modified:
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java?rev=1395592&r1=1395591&r2=1395592&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java (original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java Mon Oct  8 14:50:06 2012
@@ -47,6 +47,9 @@ public class EntryCursorImpl extends Abs
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** a reference to hold the retrieved SearchResponse object from SearchFuture */
     private Response response;
 
@@ -64,7 +67,11 @@ public class EntryCursorImpl extends Abs
      */
     public EntryCursorImpl( SearchCursor searchCursor )
     {
-        LOG_CURSOR.debug( "Creating EntryCursorImpl {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating EntryCursorImpl {}", this );
+    	}
+    	
         this.searchCursor = searchCursor;
         messageId = -1;
     }
@@ -163,7 +170,11 @@ public class EntryCursorImpl extends Abs
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing EntryCursorImpl {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing EntryCursorImpl {}", this );
+    	}
+    	
         searchCursor.close();
     }
 
@@ -174,7 +185,11 @@ public class EntryCursorImpl extends Abs
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing EntryCursorImpl {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing EntryCursorImpl {}", this );
+    	}
+    	
         searchCursor.close( cause );
     }