Esempio n. 1
0
        public void Intercept(IInvocation invocation)
        {
            if (_compositeLoggerInternal.MethodRegistered(invocation.MethodInvocationTarget))
            {
                DateTime  begin     = DateTime.Now;
                Stopwatch stopWatch = new Stopwatch();
                Exception exception = null;
                stopWatch.Start();
                try
                {
                    invocation.Proceed();
                }
                catch (Exception exc)
                {
                    exception = exc;
                    throw;
                }
                finally
                {
                    stopWatch.Stop();

                    InvocationRawData info = new InvocationRawData(invocation.MethodInvocationTarget, begin, stopWatch.Elapsed, invocation.Arguments,
                                                                   invocation.InvocationTarget, invocation.ReturnValue, exception);

                    _compositeLoggerInternal.ProcessInvocationData(info);
                }
            }
            else
            {
                invocation.Proceed();
            }
        }
Esempio n. 2
0
 public void ProcessInvocationData(InvocationRawData invocationRawData)
 {
     _loggers.ForEach(l => l.ProcessInvocationData(invocationRawData));
 }