Class LoggingExtensions
Logging extensions.
Inheritance
System.Object
LoggingExtensions
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 LoggingExtensions
Methods
| Improve this Doc View SourceGetLogger(Object, IContext)
An Object extension method that gets a logger.
Declaration
public static ILogger GetLogger(this object obj, IContext context = null)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to act on. |
IContext | context | The context used to get the log manager (optional). |
Returns
Type | Description |
---|---|
ILogger | The logger. |
Remarks
Use this method only if the object cannot get a logger through dependency injection.
GetLogger(Type, IContext)
A Type extension method that gets a logger.
Declaration
public static ILogger GetLogger(this Type type, IContext context = null)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to act on. |
IContext | context | The context used to get the log manager (optional). |
Returns
Type | Description |
---|---|
ILogger | The logger. |