Simply3DScan
SharedObjects.LogException Class Reference
Inheritance diagram for SharedObjects.LogException:
Collaboration diagram for SharedObjects.LogException:

Public Member Functions

override void OnException (MethodExecutionArgs args)
 Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception (i.e., in a catch block). More...
 

Detailed Description

Definition at line 12 of file LogException.cs.

Member Function Documentation

override void SharedObjects.LogException.OnException ( MethodExecutionArgs  args)

Method executed after the body of methods to which this aspect is applied, in case that the method resulted with an exception (i.e., in a catch block).

Parameters
argsAdvice arguments.

Definition at line 19 of file LogException.cs.

20  {
21  Arguments arguments = args.Arguments;
22 
23  StackTrace st = new StackTrace(args.Exception, true);
24  StackFrame frame = st.GetFrame(0);
25 
26  Singleton<Logger>.Instance.LogWarning($"Call to {args.Method.Name} failed");
27  foreach (object argument in arguments)
28  Singleton<Logger>.Instance.LogWarning($"Argument: {argument}");
29 
30 
31  Singleton<Logger>.Instance.LogException(args.Exception, args.Method.Name, frame.GetFileName(), frame.GetFileLineNumber());
32  args.FlowBehavior = FlowBehavior.Continue;
33  base.OnException(args);
34  }

The documentation for this class was generated from the following file: