edu.udo.cs.wvtool.util
Class WVToolLogger

java.lang.Object
  extended by edu.udo.cs.wvtool.util.WVToolLogger
Direct Known Subclasses:
StdOutLogger

public abstract class WVToolLogger
extends java.lang.Object

Singelton logging class. The log should be invoked by first calling WVToolLogger.getGlobalLogger() and then to invoke the logging operations on this object.

Version:
$Id$
Author:
Michael Wurst

Field Summary
static int EXCEPTION
           
private static WVToolLogger logger
           
private static int logLevel
           
static int STATUS
           
static int WARNING
           
 
Constructor Summary
WVToolLogger()
           
 
Method Summary
static WVToolLogger getGlobalLogger()
          Get the global logging instance.
 int getLogLevel()
          Get the current log level.
 void logException(java.lang.String s, java.lang.Exception e)
          Log an exception.
abstract  void logMessage(java.lang.String s, int level)
          Log a message, if the current log level is equal or higher than the one of the message.
static void setGlobalLogger(WVToolLogger logger)
          Set the global logging instance.
 void setLogLevel(int minLogLevel)
          Set the log level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS

public static final int STATUS
See Also:
Constant Field Values

WARNING

public static final int WARNING
See Also:
Constant Field Values

EXCEPTION

public static final int EXCEPTION
See Also:
Constant Field Values

logger

private static WVToolLogger logger

logLevel

private static int logLevel
Constructor Detail

WVToolLogger

public WVToolLogger()
Method Detail

logMessage

public abstract void logMessage(java.lang.String s,
                                int level)
Log a message, if the current log level is equal or higher than the one of the message.

Parameters:
s - the message
level - the loglevel of the message


logException

public void logException(java.lang.String s,
                         java.lang.Exception e)
Log an exception.

Parameters:
s - some additional message
e - the exception to log


setLogLevel

public void setLogLevel(int minLogLevel)
Set the log level.

Parameters:
minLogLevel - the minimal log level


getLogLevel

public int getLogLevel()
Get the current log level.

Returns:
the log level


getGlobalLogger

public static WVToolLogger getGlobalLogger()
Get the global logging instance.

Returns:
the current logger


setGlobalLogger

public static void setGlobalLogger(WVToolLogger logger)
Set the global logging instance.

Parameters:
logger - the logger