Class LogSourceExtensions
The extensions for making logging easy and flexible
Inheritance
Inherited Members
Namespace:Dapplo.Log
Assembly:Dapplo.Log.dll
Syntax
public static class LogSourceExtensions
Methods
| Improve this Doc View SourceDebug(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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |