C# Class Patterns.Logging.LoggingInterceptor

Provides an IInterceptor implementation that uses ILog to log Trace, Debug, Info, and Error events throughout the execution of intercepted invocations.
Inheritance: Patterns.Interception.DelegateInterceptor
Show file Open project: patterns-group/code-patterns

Public Methods

Method Description
LoggingInterceptor ( ILoggingConfig config, ILog>.Func logFactory, ILogValueFormatter formatter ) : System

Initializes a new instance of the LoggingInterceptor class.

LoggingInterceptor ( ILoggingConfig config, ILog>.Func logFactory, ILogValueFormatter formatter, bool>.Func condition ) : System

Initializes a new instance of the LoggingInterceptor class.

Protected Methods

Method Description
LogAfter ( IInvocation invocation ) : void
LogBefore ( IInvocation invocation ) : void
LogError ( IInvocation invocation, Exception error ) : ExceptionState
LogFinally ( IInvocation invocation ) : void

Private Methods

Method Description
Initialize ( bool>.Func condition ) : void

Method Details

LogAfter() protected method

protected LogAfter ( IInvocation invocation ) : void
invocation IInvocation
return void

LogBefore() protected method

protected LogBefore ( IInvocation invocation ) : void
invocation IInvocation
return void

LogError() protected method

protected LogError ( IInvocation invocation, Exception error ) : ExceptionState
invocation IInvocation
error System.Exception
return Patterns.ExceptionHandling.ExceptionState

LogFinally() protected method

protected LogFinally ( IInvocation invocation ) : void
invocation IInvocation
return void

LoggingInterceptor() public method

Initializes a new instance of the LoggingInterceptor class.
public LoggingInterceptor ( ILoggingConfig config, ILog>.Func logFactory, ILogValueFormatter formatter ) : System
config ILoggingConfig The config.
logFactory ILog>.Func The log factory.
formatter ILogValueFormatter The formatter.
return System

LoggingInterceptor() public method

Initializes a new instance of the LoggingInterceptor class.
public LoggingInterceptor ( ILoggingConfig config, ILog>.Func logFactory, ILogValueFormatter formatter, bool>.Func condition ) : System
config ILoggingConfig The config.
logFactory ILog>.Func The log factory.
formatter ILogValueFormatter The formatter.
condition bool>.Func The intercept condition.
return System