Show / Hide Table of Contents

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.

Inheritance
object
EmptyLoggingWrapper
Implements
ILoggingWrapper
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Zaya.Logging.Services
Assembly: Zaya.Logging.dll
Syntax
public sealed class EmptyLoggingWrapper : ILoggingWrapper

Properties

| Edit this page View Source

Instance

Shared no-op wrapper instance.

Declaration
public static EmptyLoggingWrapper Instance { get; }
Property Value
Type Description
EmptyLoggingWrapper

Methods

| Edit this page View Source

Wrap<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.

| Edit this page View Source

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 T, or instance when nothing to log.

Type Parameters
Name Description
T

Service interface type.

Implements

ILoggingWrapper
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX