[logback-dev] svn commit: r937 - logback/trunk/logback-core/src/main/java/ch/qos/logback/core/read

noreply.ceki at qos.ch noreply.ceki at qos.ch
Fri Nov 17 12:26:29 CET 2006


Author: ceki
Date: Fri Nov 17 12:26:29 2006
New Revision: 937

Modified:
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/read/CyclicBufferAppender.java

Log:
minor changes

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/read/CyclicBufferAppender.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/read/CyclicBufferAppender.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/read/CyclicBufferAppender.java	Fri Nov 17 12:26:29 2006
@@ -13,6 +13,13 @@
 import ch.qos.logback.core.Layout;
 import ch.qos.logback.core.helpers.CyclicBuffer;
 
+/**
+ * CyclicBufferAppender stores events in a cyclic buffer of user-specified size. As the 
+ * name suggests, if the size of the buffer is N, only the latest N events are available.
+ * 
+ * 
+ * @author Ceki Gulcu
+ */
 public class CyclicBufferAppender extends AppenderBase {
 
   CyclicBuffer cb;
@@ -37,7 +44,7 @@
   }
 
   public int getLength() {
-    if (cb != null) {
+    if (isStarted()) {
       return cb.length();
     } else {
       return 0;
@@ -45,7 +52,7 @@
   }
 
   public Object get(int i) {
-    if (cb != null) {
+    if (isStarted()) {
       return cb.get(i);
     } else {
       return null;
@@ -59,6 +66,9 @@
   public void setLayout(Layout layout) {
   }
 
+  /**
+   * Set the size of the cyclic buffer.
+   */
   public int getMaxSize() {
     return maxSize;
   }



More information about the logback-dev mailing list