I am currently given a task to add log statements to the project, for every method I need to add same log statement at the beginning of the method and at the end of the method. I am currently using visual studio. Is there any way or is there any option that I can use to add those log statements for all methods without the need of adding them manually.
Asked
Active
Viewed 1,161 times
1 Answers
2
What you need is an Aspect. In C# this can be achieved by using a Fody plugin: https://github.com/vescon/MethodBoundaryAspect.Fody. But be aware. Extensive logging will take down the performance of the application

Michael Mairegger
- 6,833
- 28
- 41