Fields Summary |
---|
public static final int | TRACE_INTTRACE level integer value. |
public static final Level | OFFThe OFF has the highest possible rank and is
intended to turn off logging. |
public static final Level | FATALThe FATAL level designates very severe error
events that will presumably lead the application to abort. |
public static final Level | ERRORThe ERROR level designates error events that
might still allow the application to continue running. |
public static final Level | WARNThe WARN level designates potentially harmful situations. |
public static final Level | INFOThe INFO level designates informational messages
that highlight the progress of the application at coarse-grained
level. |
public static final Level | DEBUGThe DEBUG Level designates fine-grained
informational events that are most useful to debug an
application. |
public static final Level | TRACEThe TRACE Level designates finer-grained
informational events than the DEBUG |
public static final Level | ALLThe ALL has the lowest possible rank and is intended to
turn on all logging. |
static final long | serialVersionUIDSerialization version id. |
Methods Summary |
---|
private void | readObject(java.io.ObjectInputStream s)Custom deserialization of Level.
s.defaultReadObject();
level = s.readInt();
syslogEquivalent = s.readInt();
levelStr = s.readUTF();
if (levelStr == null) {
levelStr = "";
}
|
private java.lang.Object | readResolve()Resolved deserialized level to one of the stock instances.
May be overriden in classes derived from Level.
//
// if the deserizalized object is exactly an instance of Level
//
if (getClass() == Level.class) {
return toLevel(level);
}
//
// extension of Level can't substitute stock item
//
return this;
|
public static org.apache.log4j.Level | toLevel(java.lang.String sArg)Convert the string passed as argument to a level. If the
conversion fails, then this method returns {@link #DEBUG}.
return (Level) toLevel(sArg, Level.DEBUG);
|
public static org.apache.log4j.Level | toLevel(int val)Convert an integer passed as argument to a level. If the
conversion fails, then this method returns {@link #DEBUG}.
return (Level) toLevel(val, Level.DEBUG);
|
public static org.apache.log4j.Level | toLevel(int val, org.apache.log4j.Level defaultLevel)Convert an integer passed as argument to a level. If the
conversion fails, then this method returns the specified default.
switch(val) {
case ALL_INT: return ALL;
case DEBUG_INT: return Level.DEBUG;
case INFO_INT: return Level.INFO;
case WARN_INT: return Level.WARN;
case ERROR_INT: return Level.ERROR;
case FATAL_INT: return Level.FATAL;
case OFF_INT: return OFF;
case TRACE_INT: return Level.TRACE;
default: return defaultLevel;
}
|
public static org.apache.log4j.Level | toLevel(java.lang.String sArg, org.apache.log4j.Level defaultLevel)Convert the string passed as argument to a level. If the
conversion fails, then this method returns the value of
defaultLevel .
if(sArg == null)
return defaultLevel;
String s = sArg.toUpperCase();
if(s.equals("ALL")) return Level.ALL;
if(s.equals("DEBUG")) return Level.DEBUG;
if(s.equals("INFO")) return Level.INFO;
if(s.equals("WARN")) return Level.WARN;
if(s.equals("ERROR")) return Level.ERROR;
if(s.equals("FATAL")) return Level.FATAL;
if(s.equals("OFF")) return Level.OFF;
if(s.equals("TRACE")) return Level.TRACE;
//
// For Turkish i problem, see bug 40937
//
if(s.equals("\u0130NFO")) return Level.INFO;
return defaultLevel;
|
private void | writeObject(java.io.ObjectOutputStream s)Serialize level.
s.defaultWriteObject();
s.writeInt(level);
s.writeInt(syslogEquivalent);
s.writeUTF(levelStr);
|