Log all function invocations to console

安稳与你 提交于 2019-12-02 04:20:26

There was an add-on tool someone mentioned to me, using Attributes. Let's see if I can find it.

I think it was PostSharp:

Article

http://www.postsharp.org/

You can use PostSharp to intercept all method calls and print them even with all arguments and it does not require source code changes. This CodeProject article shows how to do logging with PostSharp.

Just to note, PostSharp is an aspect-oriented programming (AOP) framework and there are some more.

If log4net is as good as log4j, then you are all set

http://logging.apache.org/log4net//index.html

In the dim dark ages of software engineering, one often used a profiling tool to achieve that since profiling injected extra code at entry and exit of all functions, although I must say that this is a pretty dismal approach to debugging and when I used it, it was a desperation move not front line. Debugging by print statement is fairly slow and ineffective.

AOP is supported also by http://www.springframework.net/

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!