Volume Control
Application-specific hotkeys for Windows
|
Asynchonously writes messages to the log endpoint. More...
Public Member Functions | |
AsyncLogWriter (IEndpointWriter endpoint, EventType eventTypeFilter) | |
Creates a new AsyncLogWriter instance with the specified endpoint and eventTypeFilter . More... | |
bool | FilterEventType (EventType eventType) |
Checks if messages with the specified eventType are shown in the log. | |
void | ResetEndpoint () |
Resets the endpoint to its default state by calling IEndpointWriter.Reset. More... | |
void | ResetEndpoint (string firstLine) |
Resets the endpoint to its default state by calling IEndpointWriter.Reset, and writes the specified firstLine . More... | |
bool | LogMessage (LogMessage logMessage) |
Writes the specified logMessage to the log, if its event type is enabled by the filter. | |
bool | Trace (params object?[] lines) |
bool | Trace (LogMessage logMessage) |
Queues writing an EventType.TRACE log message. | |
bool | Debug (params object?[] lines) |
Queues writing an EventType.DEBUG message with the specified lines . | |
bool | Debug (LogMessage logMessage) |
Queues writing an EventType.DEBUG log message. | |
bool | Info (params object?[] lines) |
Queues writing an EventType.INFO message with the specified lines . | |
bool | Info (LogMessage logMessage) |
Queues writing an EventType.INFO log message. | |
bool | Warning (params object?[] lines) |
Queues writing an EventType.WARN message with the specified lines . | |
bool | Warning (LogMessage logMessage) |
Queues writing an EventType.WARN log message. | |
bool | Error (params object?[] lines) |
Queues writing an EventType.ERROR message with the specified lines . | |
bool | Error (LogMessage logMessage) |
Queues writing an EventType.ERROR log message. | |
bool | Fatal (params object?[] lines) |
Queues writing an EventType.FATAL message with the specified lines . | |
bool | Fatal (LogMessage logMessage) |
Queues writing an EventType.FATAL log message. | |
bool | Critical (params object?[] lines) |
Queues writing an EventType.CRITICAL message with the specified lines . | |
bool | Critical (LogMessage logMessage) |
Queues writing an EventType.CRITICAL log message. | |
bool | Blank (params object?[] lines) |
Queues writing an EventType.NONE message with the specified lines . | |
bool | Blank (LogMessage logMessage) |
Queues writing an EventType.NONE log message. | |
void | DisableAsyncNoFlush () |
Sets the IsAsyncEnabled property to false without flushing the queue. More... | |
new void | Dispose () |
Public Member Functions inherited from VolumeControl.Log.Helpers.ThreadedActionQueue | |
void | Flush () |
Blocks the caller until the background thread has finished processing the queue. More... | |
bool | Flush (int timeoutMs) |
Blocks the caller until the background thread has finished processing the queue, or until the specified timeout has elapsed. More... | |
bool | Flush (int timeoutMs, bool exitContext) |
Blocks the caller until the background thread has finished processing the queue, or until the specified timeout has elapsed. More... | |
void | Dispose () |
Terminates the background thread. Does not flush the queue. More... | |
Static Public Attributes | |
const string | DateTimeFormatString = "HH:mm:ss:fff" |
The string that defines the format of timestamps. More... | |
static readonly int | TimestampLength |
Length of the timestamp segment of the line header. More... | |
static readonly int | EventTypeLength |
Length of the event type segment of the line header. More... | |
static readonly string | BlankLineHeader |
A blank string with the same length as a line header. More... | |
const EventType | AlwaysVisibleEventTypes = EventType.FATAL | EventType.CRITICAL |
Event types that are always visible. EventType.NONE is implicitly included. More... | |
Properties | |
bool | EndpointEnabled [get, set] |
Gets or sets whether the endpoint is enabled or not. More... | |
EventType | EventTypeFilter [get, set] |
Gets or sets the event type filter that determines which message types are visible for this log writer instance. More... | |
bool | IsAsyncEnabled [get, set] |
Gets or sets whether log messages are added to the queue to be written asynchronously, or written synchronously. More... | |
Events | |
PropertyChangedEventHandler? | PropertyChanged |
Additional Inherited Members | |
Protected Member Functions inherited from VolumeControl.Log.Helpers.ThreadedActionQueue | |
ThreadedActionQueue () | |
Instantiates a new ThreadedActionQueue instance. More... | |
void | Enqueue (Action action) |
Adds the specified action to the queue. More... | |
Asynchonously writes messages to the log endpoint.
VolumeControl.Log.AsyncLogWriter.AsyncLogWriter | ( | IEndpointWriter | endpoint, |
EventType | eventTypeFilter | ||
) |
Creates a new AsyncLogWriter instance with the specified endpoint and eventTypeFilter .
endpoint | A log endpoint instance. |
eventTypeFilter | The default event type filter. |
void VolumeControl.Log.AsyncLogWriter.DisableAsyncNoFlush | ( | ) |
Sets the IsAsyncEnabled property to false
without flushing the queue.
Queued messages will still be written, but any further messages will be written synchronously.
References VolumeControl.Log.AsyncLogWriter.IsAsyncEnabled.
void VolumeControl.Log.AsyncLogWriter.ResetEndpoint | ( | ) |
Resets the endpoint to its default state by calling IEndpointWriter.Reset.
Referenced by VolumeControl.Log.FLog.Initialize().
void VolumeControl.Log.AsyncLogWriter.ResetEndpoint | ( | string | firstLine | ) |
Resets the endpoint to its default state by calling IEndpointWriter.Reset, and writes the specified firstLine .
firstLine | The first line to (synchronously) write to the log. |
|
static |
Event types that are always visible. EventType.NONE is implicitly included.
Referenced by VolumeControl.Log.AsyncLogWriter.FilterEventType().
|
static |
A blank string with the same length as a line header.
|
static |
The string that defines the format of timestamps.
|
static |
Length of the event type segment of the line header.
The event type segment comes after the timestamp.
|
static |
Length of the timestamp segment of the line header.
The timestamp segment comes before the event type.
|
getset |
Gets or sets whether the endpoint is enabled or not.
|
getset |
Gets or sets the event type filter that determines which message types are visible for this log writer instance.
Referenced by VolumeControl.Log.AsyncLogWriter.FilterEventType().
|
getset |
Gets or sets whether log messages are added to the queue to be written asynchronously, or written synchronously.
true
when log messages are written asynchronously; otherwise false
.Referenced by VolumeControl.Log.AsyncLogWriter.DisableAsyncNoFlush(), and VolumeControl.Log.AsyncLogWriter.LogMessage().