You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Sylvain Wallez <sy...@apache.org> on 2005/03/13 14:05:49 UTC
Multi-level deprecation management
Hi all,
I refactored the DeprecationLogger class, which is now in
o.a.c.util.Deprecation.
Rather than a single log() method, all levels of the static
Deprecation.logger can be used to indicate various levels of deprecation.
The javadocs give some hints on how to use each level:
- debug: no more current or best practice, but no plans to remove the
feature
- info: no more current or best practice, may be removed in the future
- warn: will be removed in the next major release (e.g. 2.1.x --> 2.2.0)
- error: will be removed in the next minor release (e.g. 2.1.6 --> 2.1.7)
- fatal error: has been removed, but some code is still there to detect
attempts to use the feature.
In addition to this, a "forbidden deprecation level" has been added,
leading the logging at this level and above to throw a
DeprecationException. It can be set in web.xml and defauts to ERROR
(meaning up to WARN is allowed).
Setting this forbidden level to DEBUG runs the application in strict
mode (even non-current features are forbidden), and setting it to FATAL
runs in tolerant mode, i.e. allow everything except, of course, features
that have been removed.
This should allow us to give a clear indication to our users of what
they should give attention to if they want their apps to be maintainable
for a long time.
Sylvain
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }