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
loggerILoggerThe logger.
logLevelLogLevelThe level of significance assigned to the exception.
exceptionExceptionThe 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
loggerILoggerThe logger.
exceptionExceptionThe exception to log.
messageReadOnlySpan<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
loggerILoggerThe logger.
messageReadOnlySpan<char>The log message.
memberNamestringThe name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
filePathstringThe 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.
lineNumberintThe 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
loggerILoggerThe logger.
exceptionExceptionThe exception to log.
messageReadOnlySpan<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
loggerILoggerThe logger.
messageReadOnlySpan<char>The log message.
memberNamestringThe name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
filePathstringThe 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.
lineNumberintThe 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
loggerILoggerThe logger.
exceptionExceptionThe exception to log.
messageReadOnlySpan<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
loggerILoggerThe logger.
messageReadOnlySpan<char>The log message.
memberNamestringThe name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
filePathstringThe 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.
lineNumberintThe 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
loggerILoggerThe logger.
exceptionExceptionThe exception to log.
messageReadOnlySpan<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
loggerILoggerThe logger.
messageReadOnlySpan<char>The log message.
memberNamestringThe name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
filePathstringThe 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.
lineNumberintThe 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
loggerILoggerThe logger.
exceptionExceptionThe exception to log.
messageReadOnlySpan<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
loggerILoggerThe logger.
messageReadOnlySpan<char>The log message.
memberNamestringThe name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
filePathstringThe 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.
lineNumberintThe 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
loggerILoggerThe logger.
exceptionExceptionThe exception to log.
messageReadOnlySpan<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
loggerILoggerThe logger.
messageReadOnlySpan<char>The log message.
memberNamestringThe name of the member that called the method. Do not provide an argument. The compiler will automatically assign the correct value.
filePathstringThe 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.
lineNumberintThe 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.