de.lmu.ifi.dbs.elki.logging
Class LoggingConfiguration

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.LoggingConfiguration

public final class LoggingConfiguration
extends Object

Facility for configuration of logging.


Field Summary
private static String CLIConffile
          Configuration file name
private static String confbase
          Configuration base
protected static LoggingConfiguration config
          Static instance of the configuration
static boolean DEBUG
          General debug flag.
private static String TOPLEVEL_PACKAGE
          Top level ELKI package (for setting 'verbose')
 
Constructor Summary
private LoggingConfiguration(String pkg, String name)
          Configure Java Logging API: LogManager
 
Method Summary
static void addHandler(Handler handler)
          Add a handler to the root logger.
static void assertConfigured()
          Assert that logging was configured.
private  void privateReconfigureLogging(String pkg, String name)
          Reconfigure logging.
static void reconfigureLogging(String pkg, String name)
          Reconfigure logging.
static void replaceDefaultHandler(Handler handler)
          Replace the default log handler with the given log handler.
static void setDefaultLevel(Level level)
          Set the default level.
static void setLevelFor(String pkg, String level)
          Set the logging level for a particular package/class.
static void setVerbose(boolean verbose)
          Reconfigure logging to enable 'verbose' logging at the top level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG
General debug flag.


CLIConffile

private static final String CLIConffile
Configuration file name

See Also:
Constant Field Values

TOPLEVEL_PACKAGE

private static final String TOPLEVEL_PACKAGE
Top level ELKI package (for setting 'verbose')

See Also:
Constant Field Values

confbase

private static final String confbase
Configuration base


config

protected static LoggingConfiguration config
Static instance of the configuration

Constructor Detail

LoggingConfiguration

private LoggingConfiguration(String pkg,
                             String name)
Configure Java Logging API: LogManager

Method Detail

reconfigureLogging

public static void reconfigureLogging(String pkg,
                                      String name)
Reconfigure logging.

Parameters:
pkg - Package name the configuration file comes from
name - File name.

privateReconfigureLogging

private void privateReconfigureLogging(String pkg,
                                       String name)
Reconfigure logging.

Parameters:
pkg - Package name the configuration file comes from
name - File name.

assertConfigured

public static void assertConfigured()
Assert that logging was configured.


setVerbose

public static void setVerbose(boolean verbose)
Reconfigure logging to enable 'verbose' logging at the top level.

Parameters:
verbose - verbose flag

addHandler

public static void addHandler(Handler handler)
Add a handler to the root logger.

Parameters:
handler - Handler

replaceDefaultHandler

public static void replaceDefaultHandler(Handler handler)
Replace the default log handler with the given log handler. This will remove all CLISmartHandler found on the root logger. It will leave any other handlers in place.

Parameters:
handler - Logging handler.

setLevelFor

public static void setLevelFor(String pkg,
                               String level)
                        throws IllegalArgumentException
Set the logging level for a particular package/class.

Parameters:
pkg - Package
level - Level name
Throws:
IllegalArgumentException - thrown when logger or level was not found

setDefaultLevel

public static void setDefaultLevel(Level level)
Set the default level.

Parameters:
level - level

Release 0.4.0 (2011-09-20_1324)