|
Logifier
[
vmassol
]
How often are you trying to debug some Java application to find that you can't continue your debugging easily because the code is entering into some third-party library? At that point, either the library is open sourced and you can rush to download the source, modify the code to add some How good would it be if there was an application (let's call it a Logifier) at which you could throw a jar and it would return a new aspectified jar on which it would have weaved some Logging aspect that you could configure! This would allow us to realize the full power of aspects: an external Java application that was not built with logging can now be converted to log things for us... So who wants to be the first to build such a handy application? :-) Does it already exist? Update 7/11/04: I've just remembered reading about AntFlow on TSS. That would be an excellent way of implement this. Imagine a hot folder called "logifier" and any jar you drop in there is automatically logified using an AspectJ/AspectWerkz/etc Ant task and a common logging aspect such as this one! Now that would be cool. It could be a good coding exercise for the next OSSGTP.
This quite easy to be done with AspectJ. You can define a very generic logging aspect for pointcuts: --the_mindstorm, November 5, 2004 11:44 PM
Hi the_mindstom, Yes, this is exactly my point... :-) I've been doing this for several years in the Pattern Testing and Cactus projects (here's the Logging aspect used in Cactus if you're interested http://tinyurl.com/6byw8). My point here is simply that I haven't come across a simple and ready-to-use logifying application. That would be very handy and easy to write. --Vincent Massol, November 6, 2004 12:17 AM
I've developed an aspectJ logging aspect that uses commons-logging to output method calling (with parameters), method leaving and exception throwing. You can check the code at http://tinyurl.com/6svts, throughly tested to avoid infinite recursion, as it may happen when making implicit calls to toString. --Carlos Sanchez, November 7, 2004 04:03 PM
See http://www.csg.is.titech.ac.jp/~usui/bugdel/index-e.shtml for an Eclipse plugin that does something very similar --Vincent Massol, November 25, 2004 02:58 PM
Post a comment
|