Show / Hide Table of Contents

Class LoggerExtensions

Extension methods for ILogger.

Inheritance
System.Object
LoggerExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Logging
Assembly: Kephas.Core.dll
Syntax
public static class LoggerExtensions

Methods

| Improve this Doc View Source

Debug(ILogger, Exception, String, Object[])

Logs the exception with a formatted message at Debug level.

Declaration
public static void Debug(this ILogger logger, Exception exception, string messageFormat, params object[] args)
Parameters
Type Name Description
ILogger logger

The logger.

System.Exception exception

The exception.

System.String messageFormat

The message format.

System.Object[] args

The arguments.

| Improve this Doc View Source

Debug(ILogger, String, Object[])

Logs a formatted message at Debug level.

Declaration
public static void Debug(this ILogger logger, string messageFormat, params object[] args)
Parameters
Type Name Description
ILogger logger

The logger.

System.String messageFormat

The message format.

System.Object[] args

The arguments.

| Improve this Doc View Source

Error(ILogger, Exception, String, Object[])

Logs the exception with a formatted message at Error level.

Declaration
public static void Error(this ILogger logger, Exception exception, string messageFormat, params object[] args)
Parameters
Type Name Description
ILogger logger

The logger.

System.Exception exception

The exception.

System.String messageFormat

The message format.

System.Object[] args

The arguments.

| Improve this Doc View Source

Error(ILogger, String, Object[])

Logs a formatted message at Error level.

Declaration
public static void Error(this ILogger logger, string messageFormat, params object[] args)
Parameters
Type Name Description
ILogger logger

The logger.

System.String messageFormat

The message format.

System.Object[] args

The arguments.

| Improve this Doc View Source

Fatal(ILogger, Exception, String, Object[])

Logs the exception with a formatted message at Fatal level.

Declaration
public static void Fatal(this ILogger logger, Exception exception, string messageFormat, params object[] args)
Parameters
Type Name Description
ILogger logger

The logger.

System.Exception exception

The exception.

System.String messageFormat

The message format.

System.Object[] args

The arguments.

| Improve this Doc View Source

Fatal(ILogger, String, Object[])

Logs a formatted message at Fatal level.

Declaration
public static void Fatal(this ILogger logger, string messageFormat, params object[] args)
Parameters
Type Name Description
ILogger logger

The logger.

System.String messageFormat

The message format.

System.Object[] args

The arguments.

| Improve this Doc View Source

GetLogLevel(Exception)

Gets the log level for an exception. This is calculated to be Error if the exception does not implement ISeverityQualifiedException, otherwise the level indicated by the severity level.

Declaration
public static LogLevel GetLogLevel(this Exception exception)
Parameters
Type Name Description
System.Exception exception

The exception.

Returns
Type Description
LogLevel

The log level.

| Improve this Doc View Source

Info(ILogger, Exception, String, Object[])

Logs the exception with a formatted message at Info level.

Declaration
public static void Info(this ILogger logger, Exception exception, string messageFormat, params object[] args)
Parameters
Type Name Description
ILogger logger

The logger.

System.Exception exception

The exception.

System.String messageFormat

The message format.

System.Object[] args

The arguments.

| Improve this Doc View Source

Info(ILogger, String, Object[])

Logs a formatted message at Info level.

Declaration
public static void Info(this ILogger logger, string messageFormat, params object[] args)
Parameters
Type Name Description
ILogger logger

The logger.

System.String messageFormat

The message format.

System.Object[] args

The arguments.

| Improve this Doc View Source

IsDebugEnabled(ILogger)

Indicates whether logging is enabled at the Debug level.

Declaration
public static bool IsDebugEnabled(this ILogger logger)
Parameters
Type Name Description
ILogger logger

The logger.

Returns
Type Description
System.Boolean

true if enabled, false if not.

| Improve this Doc View Source

IsErrorEnabled(ILogger)

Indicates whether logging is enabled at the Error level.

Declaration
public static bool IsErrorEnabled(this ILogger logger)
Parameters
Type Name Description
ILogger logger

The logger.

Returns
Type Description
System.Boolean

true if enabled, false if not.

| Improve this Doc View Source

IsFatalEnabled(ILogger)

Indicates whether logging is enabled at the Fatal level.

Declaration
public static bool IsFatalEnabled(this ILogger logger)
Parameters
Type Name Description
ILogger logger

The logger.

Returns
Type Description
System.Boolean

true if enabled, false if not.

| Improve this Doc View Source

IsInfoEnabled(ILogger)

Indicates whether logging is enabled at the Info level.

Declaration
public static bool IsInfoEnabled(this ILogger logger)
Parameters
Type Name Description
ILogger logger

The logger.

Returns
Type Description
System.Boolean

true if enabled, false if not.

| Improve this Doc View Source

IsTraceEnabled(ILogger)

Indicates whether logging is enabled at the Trace level.

Declaration
public static bool IsTraceEnabled(this ILogger logger)
Parameters
Type Name Description
ILogger logger

The logger.

Returns
Type Description
System.Boolean

true if enabled, false if not.

| Improve this Doc View Source

IsWarningEnabled(ILogger)

Indicates whether logging is enabled at the Warning level.

Declaration
public static bool IsWarningEnabled(this ILogger logger)
Parameters
Type Name Description
ILogger logger

The logger.

Returns
Type Description
System.Boolean

true if enabled, false if not.

| Improve this Doc View Source

Log(ILogger, LogLevel, String, Object[])

Logs the information at the provided level.

Declaration
public static void Log(this ILogger logger, LogLevel level, string messageFormat, params object[] args)
Parameters
Type Name Description
ILogger logger

The logger.

LogLevel level

The logging level.

System.String messageFormat

The message format.

System.Object[] args

The arguments.

| Improve this Doc View Source

Log(ILogger, Exception)

Logs the exception at the log level indicated be the exception's severity level. This is calculated to be Error if the exception does not implement ISeverityQualifiedException, otherwise the level indicated by the severity level.

Declaration
public static void Log(this ILogger logger, Exception exception)
Parameters
Type Name Description
ILogger logger

The logger.

System.Exception exception

The exception.

| Improve this Doc View Source

Log(ILogger, Exception, String, Object[])

Logs the exception with a formatted message at the log level indicated be the exception's severity level. This is calculated to be Error if the exception does not implement ISeverityQualifiedException, otherwise the level indicated by the severity level.

Declaration
public static void Log(this ILogger logger, Exception exception, string messageFormat, params object[] args)
Parameters
Type Name Description
ILogger logger

The logger.

System.Exception exception

The exception.

System.String messageFormat

The message format.

System.Object[] args

The arguments.

| Improve this Doc View Source

Merge(ILogger, ILogger[])

Merges the loggers into one aggregate.

Declaration
public static ILogger Merge(this ILogger logger, params ILogger[] loggers)
Parameters
Type Name Description
ILogger logger

The logger.

ILogger[] loggers

A variable-length parameters list containing loggers.

Returns
Type Description
ILogger

An aggregated logger.

| Improve this Doc View Source

Trace(ILogger, Exception, String, Object[])

Logs the exception with a formatted message at Trace level.

Declaration
public static void Trace(this ILogger logger, Exception exception, string messageFormat, params object[] args)
Parameters
Type Name Description
ILogger logger

The logger.

System.Exception exception

The exception.

System.String messageFormat

The message format.

System.Object[] args

The arguments.

| Improve this Doc View Source

Trace(ILogger, String, Object[])

Logs a formatted message at Trace level.

Declaration
public static void Trace(this ILogger logger, string messageFormat, params object[] args)
Parameters
Type Name Description
ILogger logger

The logger.

System.String messageFormat

The message format.

System.Object[] args

The arguments.

| Improve this Doc View Source

Warn(ILogger, Exception, String, Object[])

Logs the exception with a formatted message at Warning level.

Declaration
public static void Warn(this ILogger logger, Exception exception, string messageFormat, params object[] args)
Parameters
Type Name Description
ILogger logger

The logger.

System.Exception exception

The exception.

System.String messageFormat

The message format.

System.Object[] args

The arguments.

| Improve this Doc View Source

Warn(ILogger, String, Object[])

Logs a formatted message at Warning level.

Declaration
public static void Warn(this ILogger logger, string messageFormat, params object[] args)
Parameters
Type Name Description
ILogger logger

The logger.

System.String messageFormat

The message format.

System.Object[] args

The arguments.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX