net.sf.wraplog
Class Level

java.lang.Object
  extended bynet.sf.wraplog.Level

public class Level
extends Object

Declaration of different logging levels.

Updated to WrapLog version 1.1.

Author:
Thomas Aglassinger

Field Summary
static int DEBUG
          Logging level for messages that usually are of no interest for the user.
static int ERROR
          Logging level for messages that explain why the desired operation cannot be performed.
static int INFO
          Logging level for messages that tell details about normal operations currently going on.
static int WARN
          Logging level for message that notify that the things can be processed, but the user might want to take a closer look at the current situation.
 
Constructor Summary
Level()
           
 
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
Logging level for messages that usually are of no interest for the user.

See Also:
Constant Field Values

ERROR

public static final int ERROR
Logging level for messages that explain why the desired operation cannot be performed.

Note: a simple way for deriving goog error messages is to make them fit the pattern:

cannot do something: actual state must match expectation.
Just fill in "do something", "actual state" and "expectation".

In case your code is just reporting a Java Exception that happens at a lower level on the call stack, use the pattern:

cannot do something: < exception.getMessage() >.
In practice, this often results into sucky error messages, but therer is not much you can do about it except making sure that if your own Exceptions have a useful getMessage().

See Also:
Constant Field Values

INFO

public static final int INFO
Logging level for messages that tell details about normal operations currently going on.

See Also:
Constant Field Values

WARN

public static final int WARN
Logging level for message that notify that the things can be processed, but the user might want to take a closer look at the current situation.

Note: warnings are a good indicator for bad design. They hint at the developer being to dumb to resolve a situation and therefor delegating the responsibility to the user. Preferrably, the code shoud be changed to either log INFO, throw an exception or log ERROR.

See Also:
Constant Field Values
Constructor Detail

Level

public Level()