Sounds great. But you don't need to define a custom Level for this purpose, it's already in the framework.

Just use java.util.logging.Logger.getLogger("java.awt") to create/retrieve a Logger for java.awt. The framework maintains a tree of Loggers, and passes up LogRecords to the parent logger by default. That is, a logger of "java.awt.image.jpeg" will by default forward LogRecords to the logger for "java.awt.image", which will in turn forward it to its parent, and so on.

http://developer.classpath.org/doc/java/util/logging/ Logger.html#getLogger(java.lang.String)

-- Sascha

On Jun 4, 2005, at 21:02, Casey Marshall wrote:

Lastly, I'd like to propose a standard mechanism for debug messages in
Classpath, using java.util.logging. The idea is to have
*component-level* logging, where log messages can be emitted not only by
the integer level (INFO, WARNING) but also on whether or not that exact
log level is enabled or not.

        - A global logger for Classpath, which all code should use for
          debug messages.
        - A subclass of Level that has integer level 'FINE', with
          specific component instances for components of Classpath,
          such as 'AWT', 'SECURITY', etc.
        - An implementation of Filter, with a static singleton, that
          maintains a Set of Classpath log levels -- which can be
          changed at run-time -- and only allows logging if a
          particular log level is in that set.

The idea here being that you can tune the filter to log a subset of
Classpath functionality (say, something like SECURITY|CRYPTO|JESSIE, if
I was debugging Jessie). This is, again, something I'm going to do
anyway in the context of Jessie, but wanted to know if there was general
interest in this.



_______________________________________________
Classpath mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to