Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.logging.LoggingConfiguration
All Implemented Interfaces:
Loggable

public class LoggingConfiguration
extends AbstractLoggable

Facility for configuration of logging.

Author:
Arthur Zimek

Field Summary
static int CLI
          Configuration code for command line interface.
private static boolean configurationChangeable
          Whether the LoggingConfiguration is still changeable.
static boolean DEBUG
          General debug flag.
private  DebugFilter debugFilter
          The debug filter (can be maintained).
private  Level loggerLevel
          General logger level.
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Constructor Summary
LoggingConfiguration()
          Provides a logging configuration with debugFilter set to loggerLevel.
 
Method Summary
 void configure(Logger logger, Handler[] handler)
          Configures the given logger.
 void configure(Logger logger, int configuration)
          Configures the specified logger according to the specified configuration code.
static void configureRoot(int configuration)
          Configures the root logger according to the specified configuration code.
static void configureRootFinally(int configuration)
          Configures the root logger according to the specified configuration code.
protected  Handler[] consoleHandlers()
          Provides the standard handlers for command line interface configuration.
static boolean isChangeable()
          Returns whether the LoggingConfiguration is still changeable.
 void setDebugLevel(Level level)
          Sets the level of debugFilter.
 void setLoggerLevel(Level level)
          Sets the loggerLevel to the specified level.
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configurationChangeable

private static boolean configurationChangeable
Whether the LoggingConfiguration is still changeable.


DEBUG

public static final boolean DEBUG
General debug flag.

See Also:
Constant Field Values

CLI

public static final int CLI
Configuration code for command line interface.

See Also:
Constant Field Values

loggerLevel

private Level loggerLevel
General logger level.


debugFilter

private DebugFilter debugFilter
The debug filter (can be maintained).

Constructor Detail

LoggingConfiguration

public LoggingConfiguration()
Provides a logging configuration with debugFilter set to loggerLevel. The logger level is specified via the property file. Per default, the general loggerLevel is set to ALL.

Method Detail

configure

public void configure(Logger logger,
                      int configuration)
Configures the specified logger according to the specified configuration code.

Parameters:
logger - the logger to configure
configuration - the configuration code

configure

public void configure(Logger logger,
                      Handler[] handler)
Configures the given logger. Removes all handlers currently associated with the logger and associates the given handlers instead. Finally, sets the level of the logger to the currently set loggerLevel.

Parameters:
logger - the logger to configure
handler - the handlers to associate with the logger

setLoggerLevel

public void setLoggerLevel(Level level)
Sets the loggerLevel to the specified level.

Parameters:
level - the new loggerLevel

setDebugLevel

public void setDebugLevel(Level level)
Sets the level of debugFilter.

Parameters:
level - the new level of debugFilter

consoleHandlers

protected Handler[] consoleHandlers()
Provides the standard handlers for command line interface configuration.

Returns:
an array of four CLI handlers

configureRootFinally

public static void configureRootFinally(int configuration)
Configures the root logger according to the specified configuration code.

The configuration will only be set, if configurationChangeable is true. After this method has been called, the logging configuration cannot be changed again by a method of this class.

Parameters:
configuration - the configuration code

configureRoot

public static void configureRoot(int configuration)
Configures the root logger according to the specified configuration code.

The configuration will only be set, if configurationChangeable is true.

Parameters:
configuration - the configuration code

isChangeable

public static boolean isChangeable()
Returns whether the LoggingConfiguration is still changeable.

Returns:
a boolean indicating whether the LoggingConfiguration is still changeable

Release 0.1 (2008-07-10_1838)