Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Class SampleClass
- {
- public void FunctionA()
- {
- try
- {
- //Do some work here
- }
- catch (Exception ex)
- {
- Logger.WriteLine(LogLevelEnum.Error, "SampleClass", "FunctionA Failed");
- Logger.WriteLine(LogLevelEnum.Error, "FunctionA", ex.ToString());
- }
- finally
- {
- }
- }
- }
- public class SimplestTraceAttribute : OnMethodBoundaryAspect
- {
- public override void OnEntry( MethodExecutionEventArgs eventArgs)
- {
- Trace.TraceInformation("Entering {0}.", eventArgs.Method);
- Trace.Indent();
- }
- public override void OnExit( MethodExecutionEventArgs eventArgs)
- {
- Trace.Unindent();
- Trace.TraceInformation("Leaving {0}.", eventArgs.Method);
- }
- }
Add Comment
Please, Sign In to add comment