I have tons of functions in my WinForms project and i’m using NLog for logging. I want to have an ability to wrap each function with nlogger.Info("start") and nlogger.Info("end") so i will know in which place actual exception occurred or where the code currently runs.
Is there a smart way to do it or i will need to place lines from above in all of my functions ?
I believe that PostSharp can do this for you, and can apply at the assembly level (via assembly-level attributes). However, I would be cautious of the potential performance impact. Writing the “aspect” should be pretty minimal.