Logging entry and exit of methods along with parameters automagically?

前端 未结 7 524
遇见更好的自我
遇见更好的自我 2021-01-02 04:31

Is there a way for me to add logging so that entering and exiting methods gets logged along with parameters automatically somehow for tracing purposes? How would I do so?

7条回答
  •  一生所求
    2021-01-02 04:52

    Have a look at:

    How do I intercept a method call in C#? PostSharp - il weaving - thoughts

    Also search SO for 'AOP' or 'Aspect Oriented Programming' and PostSharp...you get some interesting results.

提交回复
热议问题