Simple Log 2.0.1
[grlea]

org.grlea.log
Class DebugLevel

java.lang.Object
  extended byorg.grlea.log.DebugLevel

public final class DebugLevel
extends java.lang.Object

A Java enum defining all possible debug levels. There are seven levels, from "Fatal" (most important) to "Ludicrous" (most verbose).

Note that tracing is not related to the debug levels, as tracing is controlled independently.

Version:
$Revision: 1.2 $
Author:
$Author: grlea $

Field Summary
static DebugLevel L1_FATAL
          The "Fatal" level.
static DebugLevel L2_ERROR
          The "Error" level.
static DebugLevel L3_WARN
          The "Warning" level.
static DebugLevel L4_INFO
          The "Info" level.
static DebugLevel L5_DEBUG
          The "Debug" level.
static DebugLevel L6_VERBOSE
          The "Verbose" level.
static DebugLevel L7_LUDICROUS
          The "Ludicrous" level.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true if the given object is a DebugLevel with the same level value as this DebugLevel.
static DebugLevel fromInt(int level)
          Returns the DebugLevel object associated with the given level.
 int hashCode()
          Returns this DebugLevel's level.
 java.lang.String toString()
          Returns a string representation of this object in its current state.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

L1_FATAL

public static final DebugLevel L1_FATAL
The "Fatal" level. This should be used when an unexpected error occurs that is serious enough to cause or warrant the halting of the current process or even the whole application.


L2_ERROR

public static final DebugLevel L2_ERROR
The "Error" level. This should be used when an unexpected error occurs that cannot be recovered from.


L3_WARN

public static final DebugLevel L3_WARN
The "Warning" level. This should be used when an unexpected error occurs that CAN be recovered from.


L4_INFO

public static final DebugLevel L4_INFO
The "Info" level. This should be used for reporting information to the end user.


L5_DEBUG

public static final DebugLevel L5_DEBUG
The "Debug" level. This should be used for the most basic debugging statements. This may include the direction taken in a control structure, events fired or received and the state of important objects or variables.


L6_VERBOSE

public static final DebugLevel L6_VERBOSE
The "Verbose" level. This should be used for debugging statements that produce a large amount of output, are called often, or that don't need to be seen when performing high-level debugging. This could include extraneous events (e.g. keyboard or mouse events), the state of not-so-important objects or variables, and statements that exist within a loop. It is recommended that method parameters and return values be logged at this level (unless the amount of output they produce is "ludicrous").


L7_LUDICROUS

public static final DebugLevel L7_LUDICROUS
The "Ludicrous" level. This should be used for debugging statements that produce a ridiculous wealth of output, e.g. printing a line for every pixel in an image.

Method Detail

fromInt

public static DebugLevel fromInt(int level)
Returns the DebugLevel object associated with the given level. If the given level is above or below the defined levels, the closest level will be returned.

Parameters:
level - the level value whose corresponding DebugLevel is to be returned.
Returns:
The matching or closest matching DebugLevel.

hashCode

public int hashCode()
Returns this DebugLevel's level.


equals

public boolean equals(java.lang.Object o)
Returns true if the given object is a DebugLevel with the same level value as this DebugLevel.


toString

public java.lang.String toString()
Returns a string representation of this object in its current state.


Copyright (c) 2004-2006, Graham Lea. All rights reserved.