org.arakhne.logging
Enum LogLevel

java.lang.Object
  extended by java.lang.Enum<LogLevel>
      extended by org.arakhne.logging.LogLevel
All Implemented Interfaces:
Serializable, Comparable<LogLevel>

public enum LogLevel
extends Enum<LogLevel>

The enum describing the various available log levels.

Version:
1.7 (rev:285) 2011-10-14 12:02:59
Author:
Stéphane GALLAND, Nicolas GAUD
Maven Group Id:
org.arakhne.afc
Maven Artifact Id:
arakhneLogger

Enum Constant Summary
DEBUG
          Debug message Level.
ERROR
          Error message Level.
INFO
          Information message Level.
NONE
          No logging.
WARNING
          Warning message Level.
 
Method Summary
 boolean hasHigherPriority(LogLevel referenceLogLevel)
          Check if logging is allowed.
 boolean isAnomalyLevel()
          Replies if this log level is for anomalies.
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 are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NONE

public static final LogLevel NONE
No logging.


ERROR

public static final LogLevel ERROR
Error message Level.


WARNING

public static final LogLevel WARNING
Warning message Level.


INFO

public static final LogLevel INFO
Information message Level.


DEBUG

public static final LogLevel DEBUG
Debug message Level.

Method Detail

values

public static LogLevel[] values()
Returns an array containing the constants of this enum type, in the order they are 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 are 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
NullPointerException - if the argument is null

hasHigherPriority

public boolean hasHigherPriority(LogLevel referenceLogLevel)
Check if logging is allowed. This function check if the current log level has a priority greater or equals to the given log level.

Parameters:
referenceLogLevel - is the level to check.
Returns:
true if logging is allowed, false otherwise

isAnomalyLevel

public boolean isAnomalyLevel()
Replies if this log level is for anomalies.

Returns:
true if this log level is an error or a warning, otherwise false.


Copyright © 2006-2011 Arakhnê.org Consortium. All rights reserved under LGPL license terms.