de.fhg.igd.logging.log4j
Class Log4jLogLevel

java.lang.Object
  extended byorg.apache.log4j.Priority
      extended byorg.apache.log4j.Level
          extended byde.fhg.igd.logging.log4j.Log4jLogLevel

public class Log4jLogLevel
extends org.apache.log4j.Level

This is an extention of the Level class that comes with the Log4J package. It automatically gets initialized with LogLevel.getAll().

Version:
"$Id: Log4jLogLevel.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Matthias Pressfreund

Field Summary
private static HashSet known_
          The set of known log levels defined in LogLevel, applied to the Log4J logging mechanism
 
Fields inherited from class org.apache.log4j.Level
ALL, DEBUG, ERROR, FATAL, INFO, OFF, WARN
 
Fields inherited from class org.apache.log4j.Priority
ALL_INT, DEBUG_INT, ERROR_INT, FATAL_INT, INFO_INT, OFF_INT, WARN_INT
 
Constructor Summary
protected Log4jLogLevel(int level, String levelStr, int syslogEquiv)
          Create a Log4jLogLevel and put it into the set of known log levels (if not yet present).
 
Method Summary
private  Object readResolve()
          Serialization magic to avoid "doppelgangers" and also for performance optimization.
static org.apache.log4j.Level toLevel(int priority)
          Try to identify a level by its priority.
static org.apache.log4j.Level toLevel(String name)
          Try to identify a level by name.
 
Methods inherited from class org.apache.log4j.Level
toLevel, toLevel
 
Methods inherited from class org.apache.log4j.Priority
equals, getAllPossiblePriorities, getSyslogEquivalent, isGreaterOrEqual, toInt, toPriority, toPriority, toPriority, toPriority, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

known_

private static HashSet known_
The set of known log levels defined in LogLevel, applied to the Log4J logging mechanism

Constructor Detail

Log4jLogLevel

protected Log4jLogLevel(int level,
                        String levelStr,
                        int syslogEquiv)
Create a Log4jLogLevel and put it into the set of known log levels (if not yet present).

Method Detail

toLevel

public static org.apache.log4j.Level toLevel(String name)
Try to identify a level by name.

Parameters:
name - The log level name
Returns:
The log level that corresponds to the given name or null if the name could not be identified

toLevel

public static org.apache.log4j.Level toLevel(int priority)
Try to identify a level by its priority.

Parameters:
priority - The log level priority
Returns:
The log level that corresponds to the given priority or null if no level with the given priority could be found

readResolve

private Object readResolve()
                    throws InvalidObjectException
Serialization magic to avoid "doppelgangers" and also for performance optimization.

Throws:
InvalidObjectException - if the deserialized Log4jLogLevel does not exist


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.