55using NuLog . Dispatchers . TagRouters ;
66using NuLog . Loggers ;
77using System ;
8- using System . Collections . Concurrent ;
8+
9+ //TODO: using System.Collections.Concurrent;
910using System . Collections . Generic ;
1011using System . Diagnostics ;
1112using System . Linq ;
@@ -36,7 +37,8 @@ public class StandardDispatcher : IDispatcher
3637 /// <summary>
3738 /// A queue for storing log events to be dispatched.
3839 /// </summary>
39- private readonly ConcurrentQueue < ILogEvent > logEventQueue ;
40+ //TODO: private readonly ConcurrentQueue<ILogEvent> logEventQueue;
41+ private readonly Queue < ILogEvent > logEventQueue ;
4042
4143 /// <summary>
4244 /// The timer for processing the log queue.
@@ -60,7 +62,8 @@ public StandardDispatcher(IEnumerable<ITarget> targets, ITagRouter tagRouter, IF
6062
6163 this . fallbackLogger = fallbackLogger ;
6264
63- this . logEventQueue = new ConcurrentQueue < ILogEvent > ( ) ;
65+ //TODO: this.logEventQueue = new ConcurrentQueue<ILogEvent>();
66+ this . logEventQueue = new Queue < ILogEvent > ( ) ;
6467
6568 this . logEventQueueTimer = new Timer ( OnLogQueueTimerElapsed , this , 200 , 200 ) ;
6669 }
@@ -189,9 +192,14 @@ private static void OnLogQueueTimerElapsed(object dispatcherInstance)
189192 /// </summary>
190193 protected void ProcessLogQueue ( )
191194 {
192- ILogEvent logEvent ;
193- while ( this . logEventQueue . TryDequeue ( out logEvent ) )
195+ //TODO: ILogEvent logEvent;
196+ //while (this.logEventQueue.TryDequeue(out logEvent))
197+ //{
198+ // DispatchNow(logEvent);
199+ //}
200+ while ( this . logEventQueue . Count > 0 )
194201 {
202+ var logEvent = this . logEventQueue . Dequeue ( ) ;
195203 DispatchNow ( logEvent ) ;
196204 }
197205 }
0 commit comments