protected override void ExecuteBeforeMethodInvocation(IMethodInvocation input) { MethodInvocationData methodInvocationData = input.GetMethodInvocationData(); string preMethodMessage = string.Format("{0}{1}.{2}({3})", methodInvocationData.ClassName, methodInvocationData.Generic, methodInvocationData.MethodName, methodInvocationData.Arguments); _logger.LogMessage(preMethodMessage); }
protected override void ExecuteAfterMethodInvocation(IMethodInvocation input, IMethodReturn methodReturn) { MethodInvocationData methodInvocationData = input.GetMethodInvocationData(); string postMethodMessage = string.Format("{0}{1}.{2}({3})", methodInvocationData.ClassName, methodInvocationData.Generic, methodInvocationData.MethodName, methodReturn.ReturnValue); _logger.LogMessage(postMethodMessage); }
protected override void ExecuteAfterMethodInvocation(IMethodInvocation input, IMethodReturn methodReturn) { stopWatch.Stop(); var elapsedTime = stopWatch.Elapsed.ToString(); var methodInvocationData = input.GetMethodInvocationData(); var executionTimeSpanMessage = string.Format(" The method {0} within class {1} finsished execution in time : {2}", methodInvocationData.MethodName, methodInvocationData.ClassName, elapsedTime); logger.LogMessage(executionTimeSpanMessage); }