ConsoleLogger class¶
Attributes: [DebuggerDisplay("ConsoleLogger: {ExceptionMessageFormat}")]
Defined in
Namespace: Splat Assembly: Splat.Logging.dll Full name: Splat.ConsoleLogger Modifiers: public
Summary¶
View source (opens in a new tab)
Provides a logger implementation that writes log messages to a specified text writer, such as the console output.
Applies to
net11.0, net10.0, net47, net471, net472, net48, net481
Class hierarchy
classDiagram
class ConsoleLogger
class ILogger {
<<interface>>
}
ILogger <|.. ConsoleLogger
Implements: ILogger
Remarks¶
ConsoleLogger is typically used for simple logging scenarios where log output is directed to the console or another text stream. The logger supports configurable log levels and customizable exception message formatting. This class is not thread-safe; if used from multiple threads, external synchronization is required.
Constructors¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [ConsoleLogger](#Splat.ConsoleLogger) class that writes to Out (opens in a new tab). |
Properties¶
| Name | Summary |
|---|---|
| ExceptionMessageFormat | Gets or sets the exception message format. First parameter will be the message, second will be the exception. |
| Level | Gets the level at which the target will emit messages. |
Methods¶
| Name | Summary |
|---|---|
| Write | Writes a message to the target. |
Inherited members
System.Object.Equals(System.Object)(opens in a new tab)System.Object.Equals(System.Object,System.Object)(opens in a new tab)System.Object.GetHashCode(opens in a new tab)System.Object.GetType(opens in a new tab)System.Object.MemberwiseClone(opens in a new tab)System.Object.ReferenceEquals(System.Object,System.Object)(opens in a new tab)System.Object.ToString(opens in a new tab)