1 17 18 package org.apache.geronimo.system.logging.log4j; 19 20 import org.apache.log4j.Level; 21 22 27 public final class XLevel extends Level { 28 public static final int TRACE_INT = Level.DEBUG_INT - 1; 29 private static String TRACE_NAME = "TRACE"; 30 31 34 public static final XLevel TRACE = new XLevel(TRACE_INT, TRACE_NAME, 7); 35 36 protected XLevel(int level, String name, int syslogEquiv) { 37 super(level, name, syslogEquiv); 38 } 39 40 44 public static Level toLevel(String name) { 45 return toLevel(name, XLevel.TRACE); 46 } 47 48 53 public static Level toLevel(String name, Level defaultValue) { 54 if (name == null) { 55 return defaultValue; 56 } 57 if (name.toUpperCase().equals(TRACE_NAME)) { 58 return XLevel.TRACE; 59 } 60 return Level.toLevel(name, defaultValue); 61 } 62 63 67 public static Level toLevel(int level) throws IllegalArgumentException { 68 if (level == TRACE_INT) { 69 return XLevel.TRACE; 70 } else { 71 return Level.toLevel(level); 72 } 73 } 74 } 75 | Popular Tags |