harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Beyer" <nbe...@gmail.com>
Subject [classlib][logging] Best practices for logging within the Class Library?
Date Thu, 05 Oct 2006 01:46:50 GMT
There seem to be a number of places where logging would be useful
within the class library (and Java parts of the VM), but the rules of
engagement seems to be undefined, so it's not being used. Here's my
super-duper high-level swipe at it.

1. Use java.util.logging for normal logging (somewhat obvious).
2. Do not use java.util.logging within luni, security and kernel
modules; this is to prevent cyclical executions.
3. Use the class name for the name of the Logger; this is based on the
assumption that classes will be packaged appropriately such that
logging can be enabled by packages to get sub-system information.
4. Use the java.util.logging.Level javadoc [1] as a guide for the
appropriate logging level for a particular message. When in doubt, be
conservative and use lower levels (less than INFO).

Thoughts, comments? The big question in my mind is what modules must
be isolated from consuming java.util.logging (regarding 2 above). The
other modules that might need isolation are archive and text, but I'm
not sure about that. Any others?


[1] http://java.sun.com/j2se/1.5.0/docs/api/java/util/logging/Level.html

Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

View raw message