• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Dapplo.Log
    • AbstractLogger
    • ILogger
    • ILoggerConfiguration
    • LoggerMapper
    • LogInfo
    • LogInfoExtensions
    • LogLevels
    • LogSettings
    • LogSource
    • LogSourceExtensions
    • NullLogger
  • Dapplo.Log.LogFile
    • FileLogger
    • ForwardingLogger
    • IFileLoggerConfiguration
  • Dapplo.Log.Loggers
    • ColorConsoleLogger
    • ConsoleLogger
    • DebugLogger
    • StringWriterLogger
    • TraceLogger
  • Dapplo.Log.XUnit
    • XUnitLogger

Class LogSourceExtensions

The extensions for making logging easy and flexible

Inheritance
System.Object
LogSourceExtensions
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:Dapplo.Log
Assembly:Dapplo.Log.dll
Syntax
public static class LogSourceExtensions

Methods

| Improve this Doc View Source

Debug(LogSource, Int32, String)

This extension will create LogInfo, for LogLevels.Debug

Declaration
public static LogInfo Debug(this LogSource logSource, int lineNumber = 0, string methodName = "")
Parameters
Type Name Description
LogSource logSource

LogContext is the context (source) from where the log entry came

System.Int32 lineNumber

Should be set by the compiler, int lineNumber of the log statement

System.String methodName

Should be set by the compiler, is the calling method

Returns
Type Description
LogInfo

LogInfo

| Improve this Doc View Source

Error(LogSource, Int32, String)

This extension will create LogInfo, for LogLevels.Error

Declaration
public static LogInfo Error(this LogSource logSource, int lineNumber = 0, string methodName = "")
Parameters
Type Name Description
LogSource logSource

LogContext is the context (source) from where the log entry came

System.Int32 lineNumber

Should be set by the compiler, int lineNumber of the log statement

System.String methodName

Should be set by the compiler, is the calling method

Returns
Type Description
LogInfo

LogInfo

| Improve this Doc View Source

Fatal(LogSource, Int32, String)

This extension will create LogInfo, for LogLevels.Fatal

Declaration
public static LogInfo Fatal(this LogSource logSource, int lineNumber = 0, string methodName = "")
Parameters
Type Name Description
LogSource logSource

LogContext is the context (source) from where the log entry came

System.Int32 lineNumber

Should be set by the compiler, int lineNumber of the log statement

System.String methodName

Should be set by the compiler, is the calling method

Returns
Type Description
LogInfo

LogInfo

| Improve this Doc View Source

Info(LogSource, Int32, String)

This extension will create LogInfo, for LogLevels.Info

Declaration
public static LogInfo Info(this LogSource logSource, int lineNumber = 0, string methodName = "")
Parameters
Type Name Description
LogSource logSource

LogContext is the context (source) from where the log entry came

System.Int32 lineNumber

Should be set by the compiler, int lineNumber of the log statement

System.String methodName

Should be set by the compiler, is the calling method

Returns
Type Description
LogInfo

LogInfo

| Improve this Doc View Source

IsDebugEnabled(LogSource)

Test if LogLevels.Debug is enabled

Declaration
public static bool IsDebugEnabled(this LogSource logSource)
Parameters
Type Name Description
LogSource logSource
Returns
Type Description
System.Boolean

true if enabled

| Improve this Doc View Source

IsErrorEnabled(LogSource)

Test if LogLevels.Error enabled

Declaration
public static bool IsErrorEnabled(this LogSource logSource)
Parameters
Type Name Description
LogSource logSource
Returns
Type Description
System.Boolean

true if enabled

| Improve this Doc View Source

IsFatalEnabled(LogSource)

Test if LogLevels.Fatal is enabled

Declaration
public static bool IsFatalEnabled(this LogSource logSource)
Parameters
Type Name Description
LogSource logSource
Returns
Type Description
System.Boolean

true if enabled

| Improve this Doc View Source

IsInfoEnabled(LogSource)

Test if LogLevels.Info is enabled

Declaration
public static bool IsInfoEnabled(this LogSource logSource)
Parameters
Type Name Description
LogSource logSource
Returns
Type Description
System.Boolean

true if enabled

| Improve this Doc View Source

IsVerboseEnabled(LogSource)

Test if LogLevels.Verbose is enabled

Declaration
public static bool IsVerboseEnabled(this LogSource logSource)
Parameters
Type Name Description
LogSource logSource
Returns
Type Description
System.Boolean

true if enabled

| Improve this Doc View Source

IsWarnEnabled(LogSource)

Test if LogLevels.Warn is enabled

Declaration
public static bool IsWarnEnabled(this LogSource logSource)
Parameters
Type Name Description
LogSource logSource
Returns
Type Description
System.Boolean

true if enabled

| Improve this Doc View Source

Verbose(LogSource, Int32, String)

This extension will create LogInfo, for LogLevels.Verbose

Declaration
public static LogInfo Verbose(this LogSource logSource, int lineNumber = 0, string methodName = "")
Parameters
Type Name Description
LogSource logSource

LogContext is the context (source) from where the log entry came

System.Int32 lineNumber

Should be set by the compiler, int lineNumber of the log statement

System.String methodName

Should be set by the compiler, is the calling method

Returns
Type Description
LogInfo

LogInfo

| Improve this Doc View Source

Warn(LogSource, Int32, String)

This extension will create LogInfo, for LogLevels.Warn

Declaration
public static LogInfo Warn(this LogSource logSource, int lineNumber = 0, string methodName = "")
Parameters
Type Name Description
LogSource logSource

LogContext is the context (source) from where the log entry came

System.Int32 lineNumber

Should be set by the compiler, int lineNumber of the log statement

System.String methodName

Should be set by the compiler, is the calling method

Returns
Type Description
LogInfo

LogInfo

  • Improve this Doc
  • View Source
Back to top Copyright © 2017 Dapplo