edu.ntnu.ecosim.basicfunctionality
Class Log

java.lang.Object
  extended by edu.ntnu.ecosim.basicfunctionality.Log

public class Log
extends java.lang.Object

Light-weighted logging utility.

Author:
martin.andreas.borke

Field Summary
static int DEBUG
          The Constant DEBUG.
static int ERROR
          The Constant ERROR.
static int FATAL
          The Constant FATAL.
static int INFO
          The Constant INFO.
static int WARN
          The Constant WARN.
 
Method Summary
static Log getInstance()
          Gets the one instance of the log.
 int parseLogLevel(java.lang.String level)
          Method to convert between textual and internal integer representation of log levels
 void writeToLog(java.lang.String s, int level)
          Write to log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final int DEBUG
The Constant DEBUG.

See Also:
Constant Field Values

INFO

public static final int INFO
The Constant INFO.

See Also:
Constant Field Values

WARN

public static final int WARN
The Constant WARN.

See Also:
Constant Field Values

ERROR

public static final int ERROR
The Constant ERROR.

See Also:
Constant Field Values

FATAL

public static final int FATAL
The Constant FATAL.

See Also:
Constant Field Values
Method Detail

getInstance

public static Log getInstance()
Gets the one instance of the log.

Returns:
the instance

parseLogLevel

public int parseLogLevel(java.lang.String level)
Method to convert between textual and internal integer representation of log levels

Parameters:
level - The level (as string)
Returns:
The level (as int)

writeToLog

public void writeToLog(java.lang.String s,
                       int level)
Write to log. (or to command line if the log could not be initialized)

Parameters:
level - the level for this log entry
s - the string to write to the log