Class EmptyLoggingWrapper
No-op ILoggingWrapper: Wrap<T>(T) returns the same instance. Use as a default when logging is disabled so callers never need null checks.
Implements
Inherited Members
Namespace: Zaya.Logging.Services
Assembly: Zaya.Logging.dll
Syntax
public sealed class EmptyLoggingWrapper : ILoggingWrapper
Properties
| Edit this page View SourceInstance
Shared no-op wrapper instance.
Declaration
public static EmptyLoggingWrapper Instance { get; }
Property Value
| Type | Description |
|---|---|
| EmptyLoggingWrapper |
Methods
| Edit this page View SourceWrap<T>(Func<ILoggingWrapper, T>)
Creates an instance via factory (passing this wrapper) and wraps the result.
Declaration
public T Wrap<T>(Func<ILoggingWrapper, T> factory) where T : class
Parameters
| Type | Name | Description |
|---|---|---|
| Func<ILoggingWrapper, T> | factory | Factory that receives this wrapper and returns the implementation. |
Returns
| Type | Description |
|---|---|
| T | Wrapped instance. |
Type Parameters
| Name | Description |
|---|---|
| T | Service interface type. |
Wrap<T>(T)
Wraps instance so that implementation methods marked with LogAttribute
are logged when invoked through T.
Declaration
public T Wrap<T>(T instance) where T : class
Parameters
| Type | Name | Description |
|---|---|---|
| T | instance | Implementation instance. |
Returns
| Type | Description |
|---|---|
| T | Proxy implementing |
Type Parameters
| Name | Description |
|---|---|
| T | Service interface type. |