org.openbandy.log
Class LogLevel

java.lang.Object
  extended by org.openbandy.log.LogLevel

public final class LogLevel
extends java.lang.Object

The LogLevel class defines the different log levels as integer values, as strings and the colors that are used to print (i.e. draw) the log messages. Additionally, it provides some auxiliary conversion methods.

(c) Copyright P. Bolliger 2007, ALL RIGHTS RESERVED.

Version:
1.2
Author:
Philipp Bolliger (philipp@bolliger.name)

Field Summary
static int[] colors
          Color schema assignment to the different types of log messages
static int DEBUG
           
static int DEFAULT
           
static int ERROR
          The log levels
static int INFO
           
static java.lang.String[] levels
          Readable string assignment to the different types of log messages
static int NUMBER_OF_LEVELS
           
static int WARNING
           
 
Constructor Summary
LogLevel()
           
 
Method Summary
static int getLevelFromString(java.lang.String logLevelString)
          Get the int value of the log level which is represented as a string.
static boolean isValidLogLevel(int logLevel)
          Check if the given int is a valid log level.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR

public static final int ERROR
The log levels

See Also:
Constant Field Values

WARNING

public static final int WARNING
See Also:
Constant Field Values

INFO

public static final int INFO
See Also:
Constant Field Values

DEBUG

public static final int DEBUG
See Also:
Constant Field Values

DEFAULT

public static final int DEFAULT
See Also:
Constant Field Values

NUMBER_OF_LEVELS

public static final int NUMBER_OF_LEVELS
See Also:
Constant Field Values

levels

public static final java.lang.String[] levels
Readable string assignment to the different types of log messages


colors

public static int[] colors
Color schema assignment to the different types of log messages

Constructor Detail

LogLevel

public LogLevel()
Method Detail

getLevelFromString

public static int getLevelFromString(java.lang.String logLevelString)
Get the int value of the log level which is represented as a string. (Ingore case)

Parameters:
logLevelString - The log level as a string, e.g. Info or Debug
Returns:
The corresponding int value (e.g. 2 for Info) if no match is found, DEFAULT will be returned

isValidLogLevel

public static boolean isValidLogLevel(int logLevel)
Check if the given int is a valid log level.

Parameters:
logLevel - The log level value to check
Returns:
True, if logLevel is between ERROR and DEBUG