登录进入和退出方法与参数自动地? [英] Logging entry and exit of methods along with parameters automagically?

查看:260
本文介绍了登录进入和退出方法与参数自动地?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法为我补充记录,以便在进入和退出的方法获取与参数一同记录莫名其妙地自动追踪的目的呢?我将如何做到这一点?

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?

我使用log4net的。

I am using Log4Net.

推荐答案

有一个看看:

<一个href="http://stackoverflow.com/questions/25803/how-do-i-intercept-a-method-call-in-c#25825">http://stackoverflow.com/questions/25803/how-do-i-intercept-a-method-call-in-c#25825 <一href="http://stackoverflow.com/questions/91635/postsharp-il-weaving-thoughts">http://stackoverflow.com/questions/91635/postsharp-il-weaving-thoughts

另外的搜索,这样的AOP或面向方面编程和PostSharp ...你会得到一些有趣的结果。

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

这篇关于登录进入和退出方法与参数自动地?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆