A PostSharp aspect used to trace entry and successful exit from methods. It also measures method execution time.
Enables the logging of method entry and exit at runtime complete with parameter information and results.
You can associate the GTrace attribute with a single method, a property, or an entire class to trace all methods in that class. You can also use attribute multicasting to apply it to all matching methods in your assembly.
Trace one method within a class
public class SampleApplication
{
[GTrace]
private void InterestingMethod(int valueOne, String anotherValue)
{
//Do something interesting here
}
}
Trace all methods within a class
[GTrace]
public class SampleApplication
{
private void InterestingMethod(int valueOne, String anotherValue)
{
//Do something interesting here
}
private void AnotherInterestingMethod(int valueTwo, String anotherValue)
{
//Do something even more interesting here
}
}
System.Object
System.Attribute
PostSharp.Extensibility.MulticastAttribute
PostSharp.Aspects.Aspect
PostSharp.Aspects.MethodLevelAspect
PostSharp.Aspects.OnMethodBoundaryAspect
Gibraltar.Agent.PostSharp.GAspectBase
Gibraltar.Agent.PostSharp.GTrace
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2