|
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 . | |||
| 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. | |||
| void | ResetEndpoint (string firstLine) | ||
| Resets the endpoint to its default state by calling IEndpointWriter.Reset, and writes the specified firstLine . | |||
| bool | LogMessage (LogMessage logMessage) | ||
Writes the specified logMessage to the log, if its event type is enabled by the filter.When IsAsyncEnabled is true, the message is written asynchronously; otherwise, the message is written synchronously and the caller will be blocked until the message has been written. | |||
| 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 .This produces a message with no event type header, but a timestamp is still shown. | |||
| bool | Blank (LogMessage logMessage) | ||
| Queues writing an EventType.NONE log message.This produces a message with no event type header, but a timestamp is still shown. | |||
| void | DisableAsyncNoFlush () | ||
Sets the IsAsyncEnabled property to false without flushing the queue. | |||
| 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. | |||
| bool | Flush (int timeoutMs) | ||
| Blocks the caller until the background thread has finished processing the queue, or until the specified timeout has elapsed. | |||
| 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. | |||
| void | Dispose () | ||
| Terminates the background thread. Does not flush the queue. | |||
Static Public Attributes | |
| const string | DateTimeFormatString = "HH:mm:ss:fff" |
| The string that defines the format of timestamps. | |
| static readonly int | TimestampLength |
| Length of the timestamp segment of the line header. | |
| static readonly int | EventTypeLength |
| Length of the event type segment of the line header. | |
| static readonly string | BlankLineHeader |
| A blank string with the same length as a line header. | |
| const EventType | AlwaysVisibleEventTypes = EventType.FATAL | EventType.CRITICAL |
| Event types that are always visible. EventType.NONE is implicitly included. | |
Properties | |
| bool | EndpointEnabled [get, set] |
| Gets or sets whether the endpoint is enabled or not. | |
| EventType | EventTypeFilter [get, set] |
| Gets or sets the event type filter that determines which message types are visible for this log writer instance. | |
| bool | IsAsyncEnabled [get, set] |
| Gets or sets whether log messages are added to the queue to be written asynchronously, or written synchronously. | |
Events | |
| PropertyChangedEventHandler? | PropertyChanged |
Additional Inherited Members | |
Protected Member Functions inherited from VolumeControl.Log.Helpers.ThreadedActionQueue | |
| ThreadedActionQueue () | |
| Instantiates a new ThreadedActionQueue instance. | |
| void | Enqueue (Action action) |
| Adds the specified action to the queue. | |
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. |
| bool VolumeControl.Log.AsyncLogWriter.Blank | ( | LogMessage | logMessage | ) |
Queues writing an EventType.NONE log message.This produces a message with no event type header, but a timestamp is still shown.
Implements VolumeControl.Log.Interfaces.ILogWriter.
| bool VolumeControl.Log.AsyncLogWriter.Blank | ( | params object?[] | lines | ) |
Queues writing an EventType.NONE message with the specified lines .This produces a message with no event type header, but a timestamp is still shown.
Implements VolumeControl.Log.Interfaces.ILogWriter.
| bool VolumeControl.Log.AsyncLogWriter.Critical | ( | LogMessage | logMessage | ) |
Queues writing an EventType.CRITICAL log message.
| logMessage | A Log.LogMessage instance to write. |
Implements VolumeControl.Log.Interfaces.ILogWriter.
| bool VolumeControl.Log.AsyncLogWriter.Critical | ( | params object?[] | lines | ) |
Queues writing an EventType.CRITICAL message with the specified lines .
| lines | Any number of objects. Each object will be written on a new line. null objects and blank strings are skipped. |
Implements VolumeControl.Log.Interfaces.ILogWriter.
| bool VolumeControl.Log.AsyncLogWriter.Debug | ( | LogMessage | logMessage | ) |
Queues writing an EventType.DEBUG log message.
| logMessage | A Log.LogMessage instance to write. |
Implements VolumeControl.Log.Interfaces.ILogWriter.
| bool VolumeControl.Log.AsyncLogWriter.Debug | ( | params object?[] | lines | ) |
Queues writing an EventType.DEBUG message with the specified lines .
| lines | Any number of objects. Each object will be written on a new line. null objects and blank strings are skipped. |
Implements VolumeControl.Log.Interfaces.ILogWriter.
| 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.
| new void VolumeControl.Log.AsyncLogWriter.Dispose | ( | ) |
| bool VolumeControl.Log.AsyncLogWriter.Error | ( | LogMessage | logMessage | ) |
Queues writing an EventType.ERROR log message.
| logMessage | A Log.LogMessage instance to write. |
Implements VolumeControl.Log.Interfaces.ILogWriter.
| bool VolumeControl.Log.AsyncLogWriter.Error | ( | params object?[] | lines | ) |
Queues writing an EventType.ERROR message with the specified lines .
| lines | Any number of objects. Each object will be written on a new line. null objects and blank strings are skipped. |
Implements VolumeControl.Log.Interfaces.ILogWriter.
Referenced by VolumeControl.SDK.Internal.Initializer.Initialize(), and VolumeControl.Core.Input.Actions.HotkeyActionInstance.Invoke().
| bool VolumeControl.Log.AsyncLogWriter.Fatal | ( | LogMessage | logMessage | ) |
Queues writing an EventType.FATAL log message.
| logMessage | A Log.LogMessage instance to write. |
Implements VolumeControl.Log.Interfaces.ILogWriter.
| bool VolumeControl.Log.AsyncLogWriter.Fatal | ( | params object?[] | lines | ) |
Queues writing an EventType.FATAL message with the specified lines .
| lines | Any number of objects. Each object will be written on a new line. null objects and blank strings are skipped. |
Implements VolumeControl.Log.Interfaces.ILogWriter.
| bool VolumeControl.Log.AsyncLogWriter.FilterEventType | ( | EventType | eventType | ) |
Checks if messages with the specified eventType are shown in the log.
| eventType | An EventType to check. |
true when the eventType is shown; otherwise false.Implements VolumeControl.Log.Interfaces.ILogWriter.
References VolumeControl.Log.AsyncLogWriter.AlwaysVisibleEventTypes, and VolumeControl.Log.AsyncLogWriter.EventTypeFilter.
Referenced by VolumeControl.CoreAudio.AudioDevice.Dispose(), VolumeControl.CoreAudio.AudioSession.Dispose(), VolumeControl.Core.Input.Actions.HotkeyActionInstance.Invoke(), and VolumeControl.Log.AsyncLogWriter.LogMessage().
| bool VolumeControl.Log.AsyncLogWriter.Info | ( | LogMessage | logMessage | ) |
Queues writing an EventType.INFO log message.
| logMessage | A Log.LogMessage instance to write. |
Implements VolumeControl.Log.Interfaces.ILogWriter.
| bool VolumeControl.Log.AsyncLogWriter.Info | ( | params object?[] | lines | ) |
Queues writing an EventType.INFO message with the specified lines .
| lines | Any number of objects. Each object will be written on a new line. null objects and blank strings are skipped. |
Implements VolumeControl.Log.Interfaces.ILogWriter.
| bool VolumeControl.Log.AsyncLogWriter.LogMessage | ( | LogMessage | logMessage | ) |
Writes the specified logMessage to the log, if its event type is enabled by the filter.When IsAsyncEnabled is true, the message is written asynchronously; otherwise, the message is written synchronously and the caller will be blocked until the message has been written.
Implements VolumeControl.Log.Interfaces.ILogWriter.
References VolumeControl.Log.Helpers.ThreadedActionQueue.Enqueue(), VolumeControl.Log.LogMessage.EventType, VolumeControl.Log.AsyncLogWriter.FilterEventType(), and 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. |
| bool VolumeControl.Log.AsyncLogWriter.Trace | ( | LogMessage | logMessage | ) |
Queues writing an EventType.TRACE log message.
| logMessage | A Log.LogMessage instance to write. |
Implements VolumeControl.Log.Interfaces.ILogWriter.
| bool VolumeControl.Log.AsyncLogWriter.Warning | ( | LogMessage | logMessage | ) |
Queues writing an EventType.WARN log message.
| logMessage | A Log.LogMessage instance to write. |
Implements VolumeControl.Log.Interfaces.ILogWriter.
| bool VolumeControl.Log.AsyncLogWriter.Warning | ( | params object?[] | lines | ) |
Queues writing an EventType.WARN message with the specified lines .
| lines | Any number of objects. Each object will be written on a new line. null objects and blank strings are skipped. |
Implements VolumeControl.Log.Interfaces.ILogWriter.
|
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().
| PropertyChangedEventHandler? VolumeControl.Log.AsyncLogWriter.PropertyChanged |