A PostSharp aspect used to monitor the state of a field (member variable), recording a log message and metric when it changes.
Enables the logging of method entry and exit at runtime complete with parameter information and results.
You can associate the GField attribute with a single field or an entire class to trace all methods in that class. You can also use attribute multicasting to apply it to all matching fields or classes in your assembly (not generally recommended)
Track changes for one field within a class
public class SampleApplication
{
[GField]
private int m_TrackedField;
private void InterestingMethod(int valueOne, String anotherValue)
{
//Do something interesting here
m_TrackedField = valueOne;
}
}
System.Object
System.Attribute
PostSharp.Extensibility.MulticastAttribute
PostSharp.Aspects.Aspect
PostSharp.Aspects.LocationLevelAspect
PostSharp.Aspects.LocationInterceptionAspect
Gibraltar.Agent.PostSharp.GField
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