问题描述
我正在重构遗留应用程序,其中实际应用程序分散在许多日志记录语句之间。我可以通过删除TRACE级别日志记录(输入/退出的方法)立即受益。然而,在集成测试等的同时调试应用程序时,这被证明是有用的很多次。所以我想知道是否已经为此编写了一个可行且经过验证的(已经使用了一段时间)方面?我已经去了一些在线帖子,但它们似乎很简单(并且不确定它们是否真的被用过)用于真实项目。
I am refactoring a legacy application where the actual application is scattered in between lot of logging statements. I could immediately benefit by removing TRACE level logging (method entered/exited). However this has proven to be useful many times while debugging an app while integration testing etc. So I am wondering if there is already a working and proven (being used for a while) aspect written for this? I've gone though some online posts but they seem to simple enough (and not sure if they have ever been really used) to be used for real project.
推荐答案
从AspectJ in Action中查看方面(来源可以从)。我在实际项目的第10章中使用了非常接近的方面变体。
Checkout aspects from "AspectJ in Action" (sources can be downloaded from http://manning.com/laddad2). I have used very close variations of aspects from chapter 10 on real projects.
这篇关于是否已为TRACE日志记录编写并测试了一个方面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!