@Documented @Retention(value=RUNTIME) @Target(value={METHOD,CONSTRUCTOR}) public @interface Loggable
Logger.
For example, this load() method produces a log line
on every call:
@Loggable
String load(String resource) throws IOException {
return "something";
}
You can configure the level of logging:
@Loggable(Loggable.DEBUG)
void save(String resource) throws IOException {
// do something
}
Since version 0.7.6, you can specify a maximum execution time limit for
a method. If such a limit is reached a logging message will be issued with
a WARN priority. It is a very convenient mechanism for profiling
applications in production. Default value of a limit is 50 milliseconds:
@Loggable(limit = 200)
void save(String resource) throws IOException {
// do something, potentially slow
}LoggerCopyright © 2012-2013 jcabi.com. All Rights Reserved.