public override void LogRecord(LogRecord rec) { if (IsLevelEnabled(rec.Level)) { _queue?.Append(rec); } }
public override void LogRecord(LogRecord rec) { if (IsLevelEnabled(rec.Level)) { if (Immediately) { RenderMessage(rec); } else { _queue?.Append(rec); } } }
public void QueueProcessorTest010() { QueueProcessor <string> queue = new QueueProcessor <string>("string", str => { Console.WriteLine($"{DateTime.Now} Renderer: {str}"); Thread.Sleep(200); }); for (int i = 0; i < 70; i++) { queue.Append($"Item {i}"); } Thread.Sleep(2000); Console.WriteLine($"{DateTime.Now} dispose thread"); queue.Dispose(); Console.WriteLine($"{DateTime.Now} continue thread"); }