bb.util.logging
Class LogUtil.NodeProp

java.lang.Object
  extended by bb.util.logging.LogUtil.NodeProp
Enclosing class:
LogUtil

private static class LogUtil.NodeProp
extends Object


Field Summary
private  Set<Class<? extends Handler>> handlerClasses
           
private  Level level
           
private  Boolean useParentHandlers
           
 
Constructor Summary
private LogUtil.NodeProp()
          This private constructor suppresses the default (public) constructor, ensuring non-instantiability.
 
Method Summary
private static LogUtil.NodeProp findBest(String loggerName, String fieldName)
          Searches every key of LogUtil.nameToNodeProps to find the best match to loggerName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

level

private Level level

handlerClasses

private Set<Class<? extends Handler>> handlerClasses

useParentHandlers

private Boolean useParentHandlers
Constructor Detail

LogUtil.NodeProp

private LogUtil.NodeProp()
This private constructor suppresses the default (public) constructor, ensuring non-instantiability.

Method Detail

findBest

private static LogUtil.NodeProp findBest(String loggerName,
                                         String fieldName)
                                  throws IllegalArgumentException,
                                         Exception
Searches every key of LogUtil.nameToNodeProps to find the best match to loggerName. Here, "match" means that loggerName starts with key. Furthermore, the "best match" (in the event that multiple keys match loggerName) is the longest (in number of chars) such matching key, since that one is assumed to be the most specific. If there are multiple "best matching" keys, then one is arbitrarily chosen.

During this search, a key is rejected from consideration if its associated NodeProp does not have the required field set. Specifically, the NodeProp must have a field whose name is given by fieldName, and that field must have a non-null value if the key is to be considered.

Finally, if no matching key for loggerName whatsoever is found, and if loggerName is non-empty, and if nameToNodeProps contains the key LogUtil.nsPatternUniversalMatch, and if the NodeProp corresponding to nsPatternUniversalMatch has the field set, then that NodeProp is returned.

See the class javadocs concerning the -NS properties for more discussion.

Throws:
IllegalArgumentException - if loggerName == null; fieldName is blank
Exception - (or some subclass) if some other problem occurs