monrovia.tools
Class Logger

java.lang.Object
  |
  +--monrovia.tools.Logger

public class Logger
extends java.lang.Object

The servers logger


Field Summary
static int LOG_LEVEL_ALL
           
static int LOG_LEVEL_DEBUG
           
static int LOG_LEVEL_NONE
           
static int LOG_LEVEL_NORMAL
           
static int LOG_LEVEL_SILENT
           
static int LOG_LEVEL_VERBOSE
           
 
Constructor Summary
Logger(java.io.OutputStream pOut, int pLogLevel)
          the constructor initializes the logger to log to the given outputstream
Logger(java.io.OutputStream pOut, int pLogLevel, int pOutLevel)
          the constructor initializes the logger to log to the given outputstream
Logger(java.lang.String pFileName, int pLogLevel)
          the constructor opens the file for logging
 
Method Summary
 void close()
          close closes the loggers outputstream
static void log(java.lang.String pMessage)
          log logs the the message with LOG_LEVEL_NORMAL
static void log(java.lang.String pMessage, int pLogLevel)
          log logs the message with the given loglevel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_LEVEL_ALL

public static final int LOG_LEVEL_ALL

LOG_LEVEL_DEBUG

public static final int LOG_LEVEL_DEBUG

LOG_LEVEL_VERBOSE

public static final int LOG_LEVEL_VERBOSE

LOG_LEVEL_NORMAL

public static final int LOG_LEVEL_NORMAL

LOG_LEVEL_SILENT

public static final int LOG_LEVEL_SILENT

LOG_LEVEL_NONE

public static final int LOG_LEVEL_NONE
Constructor Detail

Logger

public Logger(java.lang.String pFileName,
              int pLogLevel)
the constructor opens the file for logging
Parameters:
pFileName - the filename to log to
pLogLevel - the servers loglevel , if messages are below this they are not logged

Logger

public Logger(java.io.OutputStream pOut,
              int pLogLevel)
the constructor initializes the logger to log to the given outputstream
Parameters:
pOut - the outputstream
pLogLevel - the log level

Logger

public Logger(java.io.OutputStream pOut,
              int pLogLevel,
              int pOutLevel)
the constructor initializes the logger to log to the given outputstream
Parameters:
pOut - the outputstream
pLogLevel - the log level
pOutLEvel - the out level
Method Detail

log

public static void log(java.lang.String pMessage)
log logs the the message with LOG_LEVEL_NORMAL
Parameters:
pMessage - the message

log

public static void log(java.lang.String pMessage,
                       int pLogLevel)
log logs the message with the given loglevel
Parameters:
pMessage - the message
pLogLevel - the loglevel of this message

close

public void close()
close closes the loggers outputstream