|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.util.Deprecation
public class Deprecation
This class provides a special static "deprecation" logger. All deprecated code should use this logger to log messages into the deprecation logger. This makes it easier for users to find out if they're using deprecated stuff.
Additionally, it is possible to set the forbidden level of deprecation messages (default
is to forbid ERROR, i.e. allow up to WARN). Messages equal to or above the forbidden level
will lead to throwing a DeprecationException
. Setting the forbidden level to
FATAL_ERROR allows running legacy applications using deprecated features (tolerant mode), and
setting the forbidden level to DEBUG will run in strict mode, forbidding all deprecations.
Note that according to the above, issuing a fatalError log always raises an exception, and can therefore be used when detecting old features that have been totally removed.
Nested Class Summary | |
---|---|
static class |
Deprecation.LogLevel
|
Field Summary | |
---|---|
static Deprecation.LogLevel |
DEBUG
Debug deprecation messages indicate features that are no more considered "current" or "best practice", but for which no removal is currently foreseen. |
static Deprecation.LogLevel |
ERROR
Error deprecation messages indicate features that will be removed in the next minor version (e.g. 2.1.6 --> 2.1.7). |
static Deprecation.LogLevel |
FATAL_ERROR
Fatal error deprecation messages indicate features that used to exist but have been removed in the current version. |
static Deprecation.LogLevel |
INFO
Info deprecation messages indicate features that are no more considered "current" or "best practice", and that will probably be removed in future releases. |
static Logger |
logger
The deprecation logger. |
static Deprecation.LogLevel |
WARN
Warning deprecation messages indicate features that will be removed in the next major version (e.g. 2.1.x --> 2.2.0). |
Constructor Summary | |
---|---|
Deprecation()
|
Method Summary | |
---|---|
static void |
setForbiddenLevel(Deprecation.LogLevel level)
|
static void |
setLogger(Logger newLogger)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Logger logger
public static final Deprecation.LogLevel DEBUG
public static final Deprecation.LogLevel INFO
public static final Deprecation.LogLevel WARN
public static final Deprecation.LogLevel ERROR
public static final Deprecation.LogLevel FATAL_ERROR
DeprecationException
.
Constructor Detail |
---|
public Deprecation()
Method Detail |
---|
public static void setLogger(Logger newLogger)
public static void setForbiddenLevel(Deprecation.LogLevel level)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |