Table of Contents

Class StringMakerILoggerExtensions

Namespace
Switchboard
Assembly
Switchboard.StringMakerILogger.dll

Provides extension methods for the ILogger interface to accept StringMaker messages.

public static class StringMakerILoggerExtensions
Inheritance
StringMakerILoggerExtensions

Fields

StackAllocMax

The maximum character length that uses stackalloc to allocate temporary memory on the stack when copying the contents of a StringMaker. If a StringMaker contains more than this number of characters, a new character array will be allocated on the heap for garbage collection.

public const int StackAllocMax = 32768

Methods

Log(ILogger, LogLevel, StringMaker, string, string, int)

Logs a StringMaker message. If the length of the message is greater than StackAllocMax, a new character array will be allocated on the heap for garbage collection.

public static void Log(this ILogger logger, LogLevel logLevel, StringMaker message, string memberName = null, string filePath = null, int lineNumber = 0)

Parameters

logger ILogger

The logger.

logLevel LogLevel

The level of significance assigned to the message.

message StringMaker

The log message.

memberName string

The name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

filePath string

The name of the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

lineNumber int

The line number within the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

Log(ILogger, LogLevel, Exception, StringMaker)

Logs an exception with a StringMaker message. If the length of the message is greater than StackAllocMax, a new character array will be allocated on the heap for garbage collection.

public static void Log(this ILogger logger, LogLevel logLevel, Exception exception, StringMaker message)

Parameters

logger ILogger

The logger.

logLevel LogLevel

The level of significance assigned to the exception.

exception Exception

The exception to log.

message StringMaker

A log message to be included with the exception.

LogCritical(ILogger, StringMaker, string, string, int)

Logs a message with the LogLevel set to Critical.

public static void LogCritical(this ILogger logger, StringMaker message, string memberName = null, string filePath = null, int lineNumber = 0)

Parameters

logger ILogger

The logger.

message StringMaker

The log message.

memberName string

The name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

filePath string

The name of the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

lineNumber int

The line number within the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

LogCritical(ILogger, Exception, StringMaker)

Logs an exception with the LogLevel set to Critical.

public static void LogCritical(this ILogger logger, Exception exception, StringMaker message)

Parameters

logger ILogger

The logger.

exception Exception

The exception to log.

message StringMaker

A log message to be included with the exception.

LogDebug(ILogger, StringMaker, string, string, int)

Logs a message with the LogLevel set to Debug.

public static void LogDebug(this ILogger logger, StringMaker message, string memberName = null, string filePath = null, int lineNumber = 0)

Parameters

logger ILogger

The logger.

message StringMaker

The log message.

memberName string

The name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

filePath string

The name of the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

lineNumber int

The line number within the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

LogDebug(ILogger, Exception, StringMaker)

Logs an exception with the LogLevel set to Debug.

public static void LogDebug(this ILogger logger, Exception exception, StringMaker message)

Parameters

logger ILogger

The logger.

exception Exception

The exception to log.

message StringMaker

A log message to be included with the exception.

LogError(ILogger, StringMaker, string, string, int)

Logs a message with the LogLevel set to Error.

public static void LogError(this ILogger logger, StringMaker message, string memberName = null, string filePath = null, int lineNumber = 0)

Parameters

logger ILogger

The logger.

message StringMaker

The log message.

memberName string

The name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

filePath string

The name of the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

lineNumber int

The line number within the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

LogError(ILogger, Exception, StringMaker)

Logs an exception with the LogLevel set to Error.

public static void LogError(this ILogger logger, Exception exception, StringMaker message)

Parameters

logger ILogger

The logger.

exception Exception

The exception to log.

message StringMaker

A log message to be included with the exception.

LogInformation(ILogger, StringMaker, string, string, int)

Logs a message with the LogLevel set to Information.

public static void LogInformation(this ILogger logger, StringMaker message, string memberName = null, string filePath = null, int lineNumber = 0)

Parameters

logger ILogger

The logger.

message StringMaker

The log message.

memberName string

The name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

filePath string

The name of the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

lineNumber int

The line number within the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

LogInformation(ILogger, Exception, StringMaker)

Logs an exception with the LogLevel set to Information.

public static void LogInformation(this ILogger logger, Exception exception, StringMaker message)

Parameters

logger ILogger

The logger.

exception Exception

The exception to log.

message StringMaker

A log message to be included with the exception.

LogTrace(ILogger, StringMaker, string, string, int)

Logs a message with the LogLevel set to Trace.

public static void LogTrace(this ILogger logger, StringMaker message, string memberName = null, string filePath = null, int lineNumber = 0)

Parameters

logger ILogger

The logger.

message StringMaker

The log message.

memberName string

The name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

filePath string

The name of the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

lineNumber int

The line number within the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

LogTrace(ILogger, Exception, StringMaker)

Logs an exception with the LogLevel set to Trace.

public static void LogTrace(this ILogger logger, Exception exception, StringMaker message)

Parameters

logger ILogger

The logger.

exception Exception

The exception to log.

message StringMaker

A log message to be included with the exception.

LogWarning(ILogger, StringMaker, string, string, int)

Logs a message with the LogLevel set to Warning.

public static void LogWarning(this ILogger logger, StringMaker message, string memberName = null, string filePath = null, int lineNumber = 0)

Parameters

logger ILogger

The logger.

message StringMaker

The log message.

memberName string

The name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

filePath string

The name of the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

lineNumber int

The line number within the file that contains the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.

LogWarning(ILogger, Exception, StringMaker)

Logs an exception with the LogLevel set to Warning.

public static void LogWarning(this ILogger logger, Exception exception, StringMaker message)

Parameters

logger ILogger

The logger.

exception Exception

The exception to log.

message StringMaker

A log message to be included with the exception.