I would like to log the start and ending of a method, but the code is messy and is hard to read:
void mymethod()
{
LogUtility.EnteringMethod();
//dowork
LogUtility.EXitingMethod();
}
I would like to convert the above to just be
void mymethod()
{
//dowork
}
But at compile/build time, I would like a macro/script to add those LogUtility lines in every one of my methods.
I know there is aspect-oriented programming, but I am looking for something significantly less complex and clunky.
Can you recommend a way to automatically generate code right before a compile/build?