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

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

public class Logging
extends Object

This class is a wrapper around Logger and LogManager offering additional convenience functions. If a class keeps a static reference to the appropriate Logging object, performance penalty compared to standard logging should be minimal. However when using LogRecord directly instead of ELKILogRecord, the use of the log(LogRecord) method will result in incorrectly logged cause location. Therefore, use ELKILogRecord!


Field Summary
private  Logger logger
          Wrapped logger
private static HashMap<String,Logging> loggers
          HashMap to keep track of loggers.
 
Constructor Summary
Logging(Logger logger)
          Constructor, wrapping a logger.
 
Method Summary
 void debug(CharSequence message)
          Log a message at the 'fine' debugging level.
 void debug(CharSequence message, Throwable e)
          Log a message at the 'fine' debugging level.
 void debugFine(CharSequence message)
          Log a message at the 'fine' debugging level.
 void debugFine(CharSequence message, Throwable e)
          Log a message at the 'fine' debugging level.
 void debugFiner(CharSequence message)
          Log a message at the 'finer' debugging level.
 void debugFiner(CharSequence message, Throwable e)
          Log a message at the 'finer' debugging level.
 void debugFinest(CharSequence message)
          Log a message at the 'finest' debugging level.
 void debugFinest(CharSequence message, Throwable e)
          Log a message at the 'finest' debugging level.
 void error(CharSequence message)
          Log a message at the 'severe' level.
 void error(CharSequence message, Throwable e)
          Log a message at the 'severe' level.
 void exception(CharSequence message, Throwable e)
          Log a message with exception at the 'severe' level.
 void exception(Throwable e)
          Log an exception at the 'severe' level.
 void fine(CharSequence message)
          Log a message at the 'fine' debugging level.
 void fine(CharSequence message, Throwable e)
          Log a message at the 'fine' debugging level.
 void finer(CharSequence message)
          Log a message at the 'finer' debugging level.
 void finer(CharSequence message, Throwable e)
          Log a message at the 'finer' debugging level.
 void finest(CharSequence message)
          Log a message at the 'finest' debugging level.
 void finest(CharSequence message, Throwable e)
          Log a message at the 'finest' debugging level.
static Logging getLogger(Class<?> c)
          Retrieve logging utility for a particular class.
static Logging getLogger(String name)
          Retrieve logging utility for a particular class.
 Logger getWrappedLogger()
           
 boolean isDebugging()
          Test whether to log 'debug' at 'FINE' level.
 boolean isDebuggingFine()
          Test whether to log 'debug' at 'FINE' level This is the same as isDebugging()
 boolean isDebuggingFiner()
          Test whether to log 'debug' at 'FINER' level
 boolean isDebuggingFinest()
          Test whether to log 'debug' at 'FINEST' level
 boolean isLoggable(Level lev)
          Verify if logging is enabled at that particular level.
 boolean isVerbose()
          Test whether to log 'verbose'.
 void log(Level level, CharSequence message)
          Log a log message at the given level.
 void log(Level level, CharSequence message, Throwable e)
          Log a log message and exception at the given level.
 void log(LogRecord rec)
          Log a given log record (should be a ELKILogRecord)
 void progress(Progress pgr)
          Log a Progress object.
 void verbose(CharSequence message)
          Log a message at the 'info' ('verbose') level.
 void verbose(CharSequence message, Throwable e)
          Log a message at the 'info' ('verbose') level.
 void warning(CharSequence message)
          Log a message at the 'warning' level.
 void warning(CharSequence message, Throwable e)
          Log a message at the 'warning' level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loggers

private static HashMap<String,Logging> loggers
HashMap to keep track of loggers.


logger

private final Logger logger
Wrapped logger

Constructor Detail

Logging

public Logging(Logger logger)
Constructor, wrapping a logger.

Parameters:
logger - Logger to wrap.
Method Detail

getLogger

public static Logging getLogger(Class<?> c)
Retrieve logging utility for a particular class.

Parameters:
c - Class to retrieve logging for
Returns:
Logger

getLogger

public static Logging getLogger(String name)
Retrieve logging utility for a particular class.

Parameters:
name - Class name
Returns:
Logger

isLoggable

public boolean isLoggable(Level lev)
Verify if logging is enabled at that particular level.

Parameters:
lev - Logging level
Returns:
status

isVerbose

public boolean isVerbose()
Test whether to log 'verbose'.

Returns:
true if verbose

isDebugging

public boolean isDebugging()
Test whether to log 'debug' at 'FINE' level. This is the same as isDebuggingFine()

Returns:
true if debug logging enabled

isDebuggingFine

public boolean isDebuggingFine()
Test whether to log 'debug' at 'FINE' level This is the same as isDebugging()

Returns:
true if debug logging enabled

isDebuggingFiner

public boolean isDebuggingFiner()
Test whether to log 'debug' at 'FINER' level

Returns:
true if debug logging enabled

isDebuggingFinest

public boolean isDebuggingFinest()
Test whether to log 'debug' at 'FINEST' level

Returns:
true if debug logging enabled

log

public void log(Level level,
                CharSequence message)
Log a log message at the given level.

Parameters:
level - Level to log at.
message - Message to log.

log

public void log(Level level,
                CharSequence message,
                Throwable e)
Log a log message and exception at the given level.

Parameters:
level - Level to log at.
message - Message to log.
e - Exception

log

public void log(LogRecord rec)
Log a given log record (should be a ELKILogRecord)

Parameters:
rec - Log record to log.

error

public void error(CharSequence message,
                  Throwable e)
Log a message at the 'severe' level.

Parameters:
message - Warning log message.
e - Exception

error

public void error(CharSequence message)
Log a message at the 'severe' level.

Parameters:
message - Warning log message.

warning

public void warning(CharSequence message,
                    Throwable e)
Log a message at the 'warning' level.

Parameters:
message - Warning log message.
e - Exception

warning

public void warning(CharSequence message)
Log a message at the 'warning' level.

Parameters:
message - Warning log message.

verbose

public void verbose(CharSequence message,
                    Throwable e)
Log a message at the 'info' ('verbose') level. You should check isVerbose() before building the message.

Parameters:
message - Informational log message.
e - Exception

verbose

public void verbose(CharSequence message)
Log a message at the 'info' ('verbose') level. You should check isVerbose() before building the message.

Parameters:
message - Informational log message.

debug

public void debug(CharSequence message,
                  Throwable e)
Log a message at the 'fine' debugging level. You should check isDebugging() before building the message.

Parameters:
message - Informational log message.
e - Exception

debug

public void debug(CharSequence message)
Log a message at the 'fine' debugging level. You should check isDebugging() before building the message.

Parameters:
message - Informational log message.

debugFine

public void debugFine(CharSequence message,
                      Throwable e)
Log a message at the 'fine' debugging level. You should check isDebugging() before building the message.

Parameters:
message - Informational log message.
e - Exception

debugFine

public void debugFine(CharSequence message)
Log a message at the 'fine' debugging level. You should check isDebugging() before building the message.

Parameters:
message - Informational log message.

fine

public void fine(CharSequence message,
                 Throwable e)
Log a message at the 'fine' debugging level. You should check isDebugging() before building the message.

Parameters:
message - Informational log message.
e - Exception

fine

public void fine(CharSequence message)
Log a message at the 'fine' debugging level. You should check isDebugging() before building the message.

Parameters:
message - Informational log message.

debugFiner

public void debugFiner(CharSequence message,
                       Throwable e)
Log a message at the 'finer' debugging level. You should check isDebugging() before building the message.

Parameters:
message - Informational log message.
e - Exception

debugFiner

public void debugFiner(CharSequence message)
Log a message at the 'finer' debugging level. You should check isDebugging() before building the message.

Parameters:
message - Informational log message.

finer

public void finer(CharSequence message,
                  Throwable e)
Log a message at the 'finer' debugging level. You should check isDebugging() before building the message.

Parameters:
message - Informational log message.
e - Exception

finer

public void finer(CharSequence message)
Log a message at the 'finer' debugging level. You should check isDebugging() before building the message.

Parameters:
message - Informational log message.

debugFinest

public void debugFinest(CharSequence message,
                        Throwable e)
Log a message at the 'finest' debugging level. You should check isDebugging() before building the message.

Parameters:
message - Informational log message.
e - Exception

debugFinest

public void debugFinest(CharSequence message)
Log a message at the 'finest' debugging level. You should check isDebugging() before building the message.

Parameters:
message - Informational log message.

finest

public void finest(CharSequence message,
                   Throwable e)
Log a message at the 'finest' debugging level. You should check isDebugging() before building the message.

Parameters:
message - Informational log message.
e - Exception

finest

public void finest(CharSequence message)
Log a message at the 'finest' debugging level. You should check isDebugging() before building the message.

Parameters:
message - Informational log message.

exception

public void exception(CharSequence message,
                      Throwable e)
Log a message with exception at the 'severe' level.

Parameters:
message - Error log message.
e - Exception

exception

public void exception(Throwable e)
Log an exception at the 'severe' level.

Parameters:
e - Exception

progress

public void progress(Progress pgr)
Log a Progress object.

Parameters:
pgr - Progress to log.

getWrappedLogger

public Logger getWrappedLogger()
Returns:
the wrapped Logger

Release 0.4.0 (2011-09-20_1324)