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
ILoggerThe logger.
logLevel
LogLevelThe level of significance assigned to the message.
message
StringMakerThe log message.
memberName
stringThe name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
filePath
stringThe 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
intThe 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
ILoggerThe logger.
logLevel
LogLevelThe level of significance assigned to the exception.
exception
ExceptionThe exception to log.
message
StringMakerA log message to be included with the exception.
LogCritical(ILogger, StringMaker, string, string, int)
public static void LogCritical(this ILogger logger, StringMaker message, string memberName = null, string filePath = null, int lineNumber = 0)
Parameters
logger
ILoggerThe logger.
message
StringMakerThe log message.
memberName
stringThe name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
filePath
stringThe 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
intThe 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)
public static void LogCritical(this ILogger logger, Exception exception, StringMaker message)
Parameters
logger
ILoggerThe logger.
exception
ExceptionThe exception to log.
message
StringMakerA log message to be included with the exception.
LogDebug(ILogger, StringMaker, string, string, int)
public static void LogDebug(this ILogger logger, StringMaker message, string memberName = null, string filePath = null, int lineNumber = 0)
Parameters
logger
ILoggerThe logger.
message
StringMakerThe log message.
memberName
stringThe name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
filePath
stringThe 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
intThe 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)
public static void LogDebug(this ILogger logger, Exception exception, StringMaker message)
Parameters
logger
ILoggerThe logger.
exception
ExceptionThe exception to log.
message
StringMakerA log message to be included with the exception.
LogError(ILogger, StringMaker, string, string, int)
public static void LogError(this ILogger logger, StringMaker message, string memberName = null, string filePath = null, int lineNumber = 0)
Parameters
logger
ILoggerThe logger.
message
StringMakerThe log message.
memberName
stringThe name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
filePath
stringThe 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
intThe 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)
public static void LogError(this ILogger logger, Exception exception, StringMaker message)
Parameters
logger
ILoggerThe logger.
exception
ExceptionThe exception to log.
message
StringMakerA 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
ILoggerThe logger.
message
StringMakerThe log message.
memberName
stringThe name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
filePath
stringThe 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
intThe 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
ILoggerThe logger.
exception
ExceptionThe exception to log.
message
StringMakerA log message to be included with the exception.
LogTrace(ILogger, StringMaker, string, string, int)
public static void LogTrace(this ILogger logger, StringMaker message, string memberName = null, string filePath = null, int lineNumber = 0)
Parameters
logger
ILoggerThe logger.
message
StringMakerThe log message.
memberName
stringThe name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
filePath
stringThe 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
intThe 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)
public static void LogTrace(this ILogger logger, Exception exception, StringMaker message)
Parameters
logger
ILoggerThe logger.
exception
ExceptionThe exception to log.
message
StringMakerA log message to be included with the exception.
LogWarning(ILogger, StringMaker, string, string, int)
public static void LogWarning(this ILogger logger, StringMaker message, string memberName = null, string filePath = null, int lineNumber = 0)
Parameters
logger
ILoggerThe logger.
message
StringMakerThe log message.
memberName
stringThe name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
filePath
stringThe 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
intThe 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)
public static void LogWarning(this ILogger logger, Exception exception, StringMaker message)
Parameters
logger
ILoggerThe logger.
exception
ExceptionThe exception to log.
message
StringMakerA log message to be included with the exception.