Class StandardLogFormatter
- Namespace
- Switchboard
- Assembly
- Switchboard.Logger.dll
Provides a standard implementation of the ILogFormatter interface.
public sealed class StandardLogFormatter : ILogFormatter
- Inheritance
-
StandardLogFormatter
- Implements
Properties
Default
Gets a static instance of the class.
public static StandardLogFormatter Default { get; }
Methods
Format(LogLevel, Exception, ReadOnlySpan<char>, StringMakerHandle)
Formats an exception
, and optional message
,
by appending the formatted output to the result
.
public void Format(LogLevel logLevel, Exception exception, ReadOnlySpan<char> message, StringMakerHandle result)
Parameters
logLevel
LogLevelThe level of significance of the
exception
.exception
ExceptionThe exception to be formatted.
message
ReadOnlySpan<char>The optional message to be formatted.
result
StringMakerHandleThe formatted result is appended here.
Format(LogLevel, ReadOnlySpan<char>, StringMakerHandle)
Formats a message
by appending the formatted output to the result
.
public void Format(LogLevel logLevel, ReadOnlySpan<char> message, StringMakerHandle result)
Parameters
logLevel
LogLevelThe level of significance of the
message
.message
ReadOnlySpan<char>The message to be formatted.
result
StringMakerHandleThe formatted result is appended here.
Format(LogLevel, ReadOnlySpan<char>, string, string, int, StringMakerHandle)
Formats a message
, including the memberName
,
filePath
, and lineNumber
that logged the message
,
by appending the formatted output to the result
.
public void Format(LogLevel logLevel, ReadOnlySpan<char> message, string memberName, string filePath, int lineNumber, StringMakerHandle result)
Parameters
logLevel
LogLevelThe level of significance of the
message
.message
ReadOnlySpan<char>The message to be formatted.
memberName
stringThe name of the method or member that logged the
message
.filePath
stringThe name of the file that logged the
message
.lineNumber
intThe line number that logged the
message
.result
StringMakerHandleThe formatted result is appended here.