Class ILoggerExtensions
- Namespace
- Switchboard
- Assembly
- Switchboard.ILogger.dll
public static class ILoggerExtensions
- Inheritance
-
ILoggerExtensions
Methods
Log(ILogger, LogLevel, Exception)
Logs an exception.
public static void Log(this ILogger logger, LogLevel logLevel, Exception exception)
Parameters
logger
ILoggerThe logger.
logLevel
LogLevelThe level of significance assigned to the exception.
exception
ExceptionThe exception to log.
LogCritical(ILogger, Exception)
public static void LogCritical(this ILogger logger, Exception exception)
Parameters
LogCritical(ILogger, Exception, ReadOnlySpan<char>)
public static void LogCritical(this ILogger logger, Exception exception, ReadOnlySpan<char> message)
Parameters
logger
ILoggerThe logger.
exception
ExceptionThe exception to log.
message
ReadOnlySpan<char>A log message to be included with the exception.
LogCritical(ILogger, ReadOnlySpan<char>, string, string, int)
public static void LogCritical(this ILogger logger, ReadOnlySpan<char> message, string memberName = null, string filePath = null, int lineNumber = 0)
Parameters
logger
ILoggerThe logger.
message
ReadOnlySpan<char>The 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)
public static void LogDebug(this ILogger logger, Exception exception)
Parameters
LogDebug(ILogger, Exception, ReadOnlySpan<char>)
public static void LogDebug(this ILogger logger, Exception exception, ReadOnlySpan<char> message)
Parameters
logger
ILoggerThe logger.
exception
ExceptionThe exception to log.
message
ReadOnlySpan<char>A log message to be included with the exception.
LogDebug(ILogger, ReadOnlySpan<char>, string, string, int)
public static void LogDebug(this ILogger logger, ReadOnlySpan<char> message, string memberName = null, string filePath = null, int lineNumber = 0)
Parameters
logger
ILoggerThe logger.
message
ReadOnlySpan<char>The 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)
public static void LogError(this ILogger logger, Exception exception)
Parameters
LogError(ILogger, Exception, ReadOnlySpan<char>)
public static void LogError(this ILogger logger, Exception exception, ReadOnlySpan<char> message)
Parameters
logger
ILoggerThe logger.
exception
ExceptionThe exception to log.
message
ReadOnlySpan<char>A log message to be included with the exception.
LogError(ILogger, ReadOnlySpan<char>, string, string, int)
public static void LogError(this ILogger logger, ReadOnlySpan<char> message, string memberName = null, string filePath = null, int lineNumber = 0)
Parameters
logger
ILoggerThe logger.
message
ReadOnlySpan<char>The 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)
Logs an exception with the LogLevel set to Information.
public static void LogInformation(this ILogger logger, Exception exception)
Parameters
LogInformation(ILogger, Exception, ReadOnlySpan<char>)
Logs an exception with the LogLevel set to Information.
public static void LogInformation(this ILogger logger, Exception exception, ReadOnlySpan<char> message)
Parameters
logger
ILoggerThe logger.
exception
ExceptionThe exception to log.
message
ReadOnlySpan<char>A log message to be included with the exception.
LogInformation(ILogger, ReadOnlySpan<char>, string, string, int)
Logs a message with the LogLevel set to Information.
public static void LogInformation(this ILogger logger, ReadOnlySpan<char> message, string memberName = null, string filePath = null, int lineNumber = 0)
Parameters
logger
ILoggerThe logger.
message
ReadOnlySpan<char>The 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)
public static void LogTrace(this ILogger logger, Exception exception)
Parameters
LogTrace(ILogger, Exception, ReadOnlySpan<char>)
public static void LogTrace(this ILogger logger, Exception exception, ReadOnlySpan<char> message)
Parameters
logger
ILoggerThe logger.
exception
ExceptionThe exception to log.
message
ReadOnlySpan<char>A log message to be included with the exception.
LogTrace(ILogger, ReadOnlySpan<char>, string, string, int)
public static void LogTrace(this ILogger logger, ReadOnlySpan<char> message, string memberName = null, string filePath = null, int lineNumber = 0)
Parameters
logger
ILoggerThe logger.
message
ReadOnlySpan<char>The 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)
public static void LogWarning(this ILogger logger, Exception exception)
Parameters
LogWarning(ILogger, Exception, ReadOnlySpan<char>)
public static void LogWarning(this ILogger logger, Exception exception, ReadOnlySpan<char> message)
Parameters
logger
ILoggerThe logger.
exception
ExceptionThe exception to log.
message
ReadOnlySpan<char>A log message to be included with the exception.
LogWarning(ILogger, ReadOnlySpan<char>, string, string, int)
public static void LogWarning(this ILogger logger, ReadOnlySpan<char> message, string memberName = null, string filePath = null, int lineNumber = 0)
Parameters
logger
ILoggerThe logger.
message
ReadOnlySpan<char>The 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.