Created
February 14, 2012 21:50
-
-
Save mgroves/1830804 to your computer and use it in GitHub Desktop.
Simple trace aspect in PostSharp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Serializable] | |
| public class TraceAttribute : OnMethodBoundaryAspect | |
| { | |
| public override void OnEntry(MethodExecutionEventArgs args) | |
| { | |
| Trace.TraceInformation("Entering {0}.", args.Method); | |
| } | |
| public override void OnExit(MethodExecutionEventArgs args) | |
| { | |
| Trace.TraceInformation("Leaving {0}.", args.Method); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment