Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

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

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
All Implemented Interfaces:
Loggable
Direct Known Subclasses:
AbstractDatabaseObject, AbstractDistance, AbstractNumberConstraint, AbstractPage, AbstractParameterizable, AbstractResult, AllOrNoneMustBeSetGlobalConstraint, AssociationMaps, Associations, Bicluster, BulkSplit, CASHIntervalSplit, ClassLabel, Cluster, ConstantObject, DefaultValueGlobalConstraint, DistanceFunctionPatternConstraint, EqualSizeGlobalConstraint, EqualStringConstraint, GlobalDistanceFunctionPatternConstraint, GlobalListSizeConstraint, GlobalVectorListElementSizeConstraint, HierarchicalCluster, HyperBoundingBox, IntervalConstraint, KNNList, LessEqualGlobalConstraint, LessGlobalConstraint, LinearEquationSystem, LinearRegression, ListSizeConstraint, LoggingConfiguration, Matrix, MultipleLinearRegression, NotEqualValueGlobalConstraint, OneMustBeSetGlobalConstraint, OnlyOneIsAllowedToBeSetGlobalConstraint, Option, OptionHandler, PageFile, ParameterFlagGlobalConstraint, PersistentHeap, PrettyPrinter, Properties, SelectiveFilter, StaticLogger, Util, ZCurve

public abstract class AbstractLoggable
extends Object
implements Loggable

Abstract superclass for classes being loggable, i.e. classes intending to log messages.

Provides method implementations of the Loggable interface.

Author:
Steffi Wanka

Field Summary
protected  boolean debug
          Holds the class specific debug status.
private  Logger logger
          The logger of the class.
 
Constructor Summary
protected AbstractLoggable(boolean debug)
          Initializes the logger and sets the debug status to the given value.
protected AbstractLoggable(boolean debug, String name)
          Initializes the logger with the given name and sets the debug status to the given value.
 
Method Summary
 void debugFine(String msg)
          Log a DEBUG_FINE message.
 void debugFiner(String msg)
          Log a DEBUG_FINER message.
 void debugFinest(String msg)
          Log a DEBUG_FINEST message.
 void exception(String msg, Throwable e)
          Log an EXCEPTION message.
private  String inferCaller(String className)
           
 void message(String msg)
          Log a message with Level MESSAGE.
 void progress(LogRecord record)
          Log a PROGRESS message.
 void progress(Progress pgr)
          Log a PROGRESS message.
 void progress(Progress pgr, int numClusters)
          Log a PROGRESS message.
 void verbose()
          Log an empty VERBOSE message.
 void verbose(String msg)
          Log a VERBOSE message.
 void warning(String msg)
          Log a WARNING message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

protected boolean debug
Holds the class specific debug status.


logger

private final Logger logger
The logger of the class.

Constructor Detail

AbstractLoggable

protected AbstractLoggable(boolean debug)
Initializes the logger and sets the debug status to the given value.

Parameters:
debug - the debug status.

AbstractLoggable

protected AbstractLoggable(boolean debug,
                           String name)
Initializes the logger with the given name and sets the debug status to the given value.

Parameters:
debug - the debub status.
name - the name of the logger.
Method Detail

exception

public void exception(String msg,
                      Throwable e)
Log an EXCEPTION message.

If the logger is currently enabled for the EXCEPTION message level then the given message is forwarded to all the registered output Handler objects.

Specified by:
exception in interface Loggable
Parameters:
msg - The String message
See Also:
Loggable.exception(String, Throwable)

warning

public void warning(String msg)
Log a WARNING message.

If the logger is currently enabled for the WARNING message level then the given message is forwarded to all the registered output Handler objects.

Specified by:
warning in interface Loggable
Parameters:
msg - The String message
See Also:
Loggable.warning(String)

message

public void message(String msg)
Log a message with Level MESSAGE.

If the logger is currently enabled for the MESSAGE level then the given message is forwarded to all the registered output Handler objects.

Specified by:
message in interface Loggable
Parameters:
msg - The String message
See Also:
Loggable.message(String)

progress

public void progress(Progress pgr)
Log a PROGRESS message.

If the logger is currently enabled for the PROGRESS message level then the given message is forwarded to all the registered output Handler objects.

Specified by:
progress in interface Loggable
Parameters:
pgr - The Progress to be logged.
See Also:
Loggable.progress(de.lmu.ifi.dbs.elki.utilities.Progress)

progress

public void progress(Progress pgr,
                     int numClusters)
Log a PROGRESS message.

If the logger is currently enabled for the PROGRESS message level then the given message is forwarded to all the registered output Handler objects.

Parameters:
pgr - The Progress to be logged.
numClusters - The current number of clusters
See Also:
Loggable.progress(de.lmu.ifi.dbs.elki.utilities.Progress)

progress

public void progress(LogRecord record)
Log a PROGRESS message.

If the logger is currently enabled for the PROGRESS message level then the given message is forwarded to all the registered output Handler objects.

Specified by:
progress in interface Loggable
Parameters:
record - the log record to be logged
See Also:
Loggable.progress(java.util.logging.LogRecord)

verbose

public void verbose(String msg)
Log a VERBOSE message.

If the logger is currently enabled for the VERBOSE message level then the given message is forwarded to all the registered output Handler objects.

Specified by:
verbose in interface Loggable
Parameters:
msg - The string message
See Also:
Loggable.verbose(String)

verbose

public void verbose()
Log an empty VERBOSE message.

If the logger is currently enabled for the VERBOSE message level then the given message is forwarded to all the registered output Handler objects. Use this method to insert a newline in the verbose log.

Specified by:
verbose in interface Loggable
See Also:
verbose(String)

debugFine

public void debugFine(String msg)
Log a DEBUG_FINE message.

If the logger is currently enabled for the DEBUG_FINE message level then the given message is forwarded to all the registered output Handler objects.

Specified by:
debugFine in interface Loggable
Parameters:
msg - The string message
See Also:
Loggable.debugFine(String)

debugFiner

public void debugFiner(String msg)
Log a DEBUG_FINER message.

If the logger is currently enabled for the DEBUG_FINER message level then the given message is forwarded to all the registered output Handler objects.

Specified by:
debugFiner in interface Loggable
Parameters:
msg - The string message
See Also:
Loggable.debugFiner(String)

debugFinest

public void debugFinest(String msg)
Log a DEBUG_FINEST message.

If the logger is currently enabled for the DEBUG_FINEST message level then the given message is forwarded to all the registered output Handler objects.

Specified by:
debugFinest in interface Loggable
Parameters:
msg - The string message
See Also:
Loggable.debugFinest(String)

inferCaller

private String inferCaller(String className)

Release 0.1 (2008-07-10_1838)