Friday, October 4, 2002 04:04 AM
That is an aspect of AOP (aspect oriented programming). There are some add´s to java to realize AOP (e.g. AspectJ). Logging can be done with the Logging API of JDK 1.4 or with Apaches log4j. Log4J is configured by XML-file, so you can log with different levels.
If you want to do some more, you can write your own precompiler (parses your code and generate "standard" java source code).
If you want do something before/after invoking methods you can use Proxies.