@Documented @Inherited @Retention(value=RUNTIME) @Target(value=TYPE) public @interface Logged
@Logged(errorLogLevel = LogLevel.WARN, executionLevel = LogLevel.DEBUG) class A { ... }Will define that the invocation of A should be logged with log level WARN when logging an exception, and that in case of return values it shouldn't expand them (print their
toString()
representation) unless the log level
DEBUG is on. All other definitions are taken from their default values.Modifier and Type | Optional Element and Description |
---|---|
Logged.LogLevel |
errorLevel
The log level for method exit (by exception).
Default: Logged.LogLevel.ERROR . |
Logged.LogLevel |
executionLevel
The log level for method execution (entry + return).
Default: Logged.LogLevel.INFO . |
Logged.LogLevel |
parametersLevel
The parameters level determines when should the command parameters be expanded (printed in whole).
|
Logged.LogLevel |
returnLevel
The return level determines when should the command's return value be expanded (printed in whole).
|
public abstract Logged.LogLevel executionLevel
Logged.LogLevel.INFO
.public abstract Logged.LogLevel errorLevel
Logged.LogLevel.ERROR
.public abstract Logged.LogLevel parametersLevel
executionLevel()
is used as a logical upper-bound for this parameter, so it makes no sense to set
it higher than that.executionLevel()
, and the executionLevel()
is
enabled in the log, then:
Logged.LogLevel.INFO
.public abstract Logged.LogLevel returnLevel
executionLevel()
is used as a logical upper-bound for this parameter, so it makes no sense to set
it higher than that.executionLevel()
, and the executionLevel()
is
enabled in the log, then:
Logged.LogLevel.INFO
.Copyright © 2012. All Rights Reserved.