com.aliasi.io
Enum LogLevel

java.lang.Object
  extended by java.lang.Enum<LogLevel>
      extended by com.aliasi.io.LogLevel
All Implemented Interfaces:
Serializable, Comparable<LogLevel>

public enum LogLevel
extends Enum<LogLevel>

A LogLevel is used to indicate a severity level for selecting which logging messages to report.

The static singleton comparator COMPARATOR may be used to compare severity levels.

Unlike other commonly used logging packages (e.g. Java Logging, Log4J, Jakarta Commons Logging), this logging package is completely configuration free in the sense that it is configured entirely through the API.

Each logging level has an integer severity level. A Reporter will report messages that are at or above its specified level.

The logging levels in increasing order of severity are:

There are also two special levels which bound the regular severity levels.

The levels were chosen to follow the most popular loggers for Java:

Since:
Lingpipe3.8
Version:
3.8
Author:
Bob Carpenter

Enum Constant Summary
ALL
          Special level with lowest possible severity.
DEBUG
          Fine-grained debugging.
ERROR
          Error that may be recoverable.
FATAL
          Unrecoverable error.
INFO
          Coarse-grained application flow information.
NONE
          Special severity with level higher than all other levels.
TRACE
          Very detailed debugging information.
WARN
          Possibly harmful situation .
 
Field Summary
static Comparator<LogLevel> COMPARATOR
          Returns a comparator that compares levels by severity.
 
Method Summary
static LogLevel valueOf(String name)
          Returns the enum constant of this type with the specified name.
static LogLevel[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ALL

public static final LogLevel ALL
Special level with lowest possible severity.


TRACE

public static final LogLevel TRACE
Very detailed debugging information.


DEBUG

public static final LogLevel DEBUG
Fine-grained debugging.


INFO

public static final LogLevel INFO
Coarse-grained application flow information.


WARN

public static final LogLevel WARN
Possibly harmful situation .


ERROR

public static final LogLevel ERROR
Error that may be recoverable.


FATAL

public static final LogLevel FATAL
Unrecoverable error.


NONE

public static final LogLevel NONE
Special severity with level higher than all other levels.

Field Detail

COMPARATOR

public static final Comparator<LogLevel> COMPARATOR
Returns a comparator that compares levels by severity. If level1 is more severe than level2, LogLevel.COMPARATOR.compare(level1,level2) returns 1, if level1 is less severe than level2, it returns -1, and if they are equally severe, it returns 0.

Method Detail

values

public static final LogLevel[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(LogLevel c : LogLevel.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static LogLevel valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name