FileDocCategorySizeDatePackage
AppLoggers.javaAPI DocAndroid 1.5 API3084Wed May 06 22:41:16 BST 2009com.vladium.emma

AppLoggers

public abstract class AppLoggers extends Object
author
Vlad Roubtsov, (C) 2004

Fields Summary
public static final String
PREFIX_VERBOSITY
public static final String
PROPERTY_VERBOSITY_LEVEL
public static final String
DEFAULT_VERBOSITY_LEVEL
public static final String
PROPERTY_VERBOSITY_FILTER
private static final String
COMMA_DELIMITERS
Constructors Summary
private AppLoggers()

Methods Summary
public static com.vladium.logging.Loggercreate(java.lang.String appName, com.vladium.util.IProperties properties, com.vladium.logging.Logger base)

    
                
    
        if (properties == null)
            throw new IllegalArgumentException ("null input: properties");
        
        // verbosity level:
        
        final int level;
        {
            final String _level = properties.getProperty (PROPERTY_VERBOSITY_LEVEL,
                                                          DEFAULT_VERBOSITY_LEVEL);
            level = Logger.stringToLevel (_level);
        }
        
        // verbosity filter:
        
        final Set filter;
        {
            final String _filter = properties.getProperty (PROPERTY_VERBOSITY_FILTER);
            Set temp = null;
            
            if (_filter != null)
            {
                final StringTokenizer tokenizer = new StringTokenizer (_filter, COMMA_DELIMITERS);
                if (tokenizer.countTokens () > 0)
                {
                    temp = new HashSet (tokenizer.countTokens ());
                    while (tokenizer.hasMoreTokens ())
                    {
                        temp.add (tokenizer.nextToken ());
                    }
                }
            }
            
            filter = temp;
        }
        
        return Logger.create (level, null, appName, filter, base);