Table of Contents

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 LogLevel

The level of significance of the exception.

exception Exception

The exception to be formatted.

message ReadOnlySpan<char>

The optional message to be formatted.

result StringMakerHandle

The 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 LogLevel

The level of significance of the message.

message ReadOnlySpan<char>

The message to be formatted.

result StringMakerHandle

The 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 LogLevel

The level of significance of the message.

message ReadOnlySpan<char>

The message to be formatted.

memberName string

The name of the method or member that logged the message.

filePath string

The name of the file that logged the message.

lineNumber int

The line number that logged the message.

result StringMakerHandle

The formatted result is appended here.