C# Class Catel.Logging.BatchLogListenerBase

Base class for log listeners that can write in batches.
Inheritance: LogListenerBase, IBatchLogListener
Show file Open project: Catel/Catel

Public Methods

Method Description
BatchLogListenerBase ( int maxBatchCount = 100 ) : System

Initializes a new instance of the BatchLogListenerBase class.

Flush ( ) : Task

Flushes the current queue asynchronous.

Protected Methods

Method Description
Write ( ILog log, string message, LogEvent logEvent, object extraData, LogData logData, System.DateTime time ) : void

Called when any message is written to the log.

WriteBatchAsync ( List batchEntries ) : Task

Writes the batch of entries.

Private Methods

Method Description
OnTimerTick ( object state ) : void
WriteBatch ( List batchEntries ) : Task

Method Details

BatchLogListenerBase() public method

Initializes a new instance of the BatchLogListenerBase class.
public BatchLogListenerBase ( int maxBatchCount = 100 ) : System
maxBatchCount int The maximum batch count.
return System

Flush() public method

Flushes the current queue asynchronous.
public Flush ( ) : Task
return Task

Write() protected method

Called when any message is written to the log.
protected Write ( ILog log, string message, LogEvent logEvent, object extraData, LogData logData, System.DateTime time ) : void
log ILog The log.
message string The message.
logEvent LogEvent The log event.
extraData object The additional data.
logData LogData The log data.
time System.DateTime The time.
return void

WriteBatchAsync() protected method

Writes the batch of entries.
protected WriteBatchAsync ( List batchEntries ) : Task
batchEntries List The batch entries.
return Task