You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by ni...@apache.org on 2004/06/02 18:28:02 UTC

cvs commit: logging-log4net/src/Appender BufferingAppenderSkeleton.cs

nicko       2004/06/02 09:28:02

  Modified:    src/Appender BufferingAppenderSkeleton.cs
  Log:
  Updated to use new CyclicBuffer.Append method
  
  Revision  Changes    Path
  1.6       +3 -6      logging-log4net/src/Appender/BufferingAppenderSkeleton.cs
  
  Index: BufferingAppenderSkeleton.cs
  ===================================================================
  RCS file: /home/cvs/logging-log4net/src/Appender/BufferingAppenderSkeleton.cs,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- BufferingAppenderSkeleton.cs	30 May 2004 17:58:48 -0000	1.5
  +++ BufferingAppenderSkeleton.cs	2 Jun 2004 16:28:02 -0000	1.6
  @@ -357,11 +357,8 @@
   				// volatile data in the event.
   				loggingEvent.Fix = this.Fix;
   
  -				// catch the event discarded from the buffer
  -				LoggingEvent discardedLoggingEvent;
  -
  -				// Add to the buffer, returns true if there is space remaining after the append
  -				bool space = m_cb.Append(loggingEvent, out discardedLoggingEvent);
  +				// Add to the buffer, returns the event discarded from the buffer if there is no space remaining after the append
  +				LoggingEvent discardedLoggingEvent = m_cb.Append(loggingEvent);
   
   				// Check if the discarded event should be logged
   				if (discardedLoggingEvent != null && m_lossyEvaluator != null && m_lossyEvaluator.IsTriggeringEvent(discardedLoggingEvent))
  @@ -371,7 +368,7 @@
   
   				// If the buffer is full & not lossy then send the buffer, otherwise check if
   				// the event will trigger the whole buffer to be sent
  -				if ((!space && !m_lossy) || (m_evaluator != null && m_evaluator.IsTriggeringEvent(loggingEvent)) )
  +				if ((discardedLoggingEvent!=null && !m_lossy) || (m_evaluator != null && m_evaluator.IsTriggeringEvent(loggingEvent)) )
   				{
   					SendBuffer(m_cb);
   				}