1 18 19 package org.objectweb.util.monolog.wrapper.log4jMini; 20 21 import org.apache.log4j.Priority; 22 import org.objectweb.util.monolog.api.BasicLevel; 23 import org.objectweb.util.monolog.api.Level; 24 import org.objectweb.util.monolog.api.LevelFactory; 25 26 30 public class LevelImpl 31 extends org.objectweb.util.monolog.wrapper.common.LevelImpl { 32 33 static public Priority convertLevel(Level l) { 34 return Priority.toPriority(l.getIntValue()); 35 } 36 37 static public Level getLevel(int value) { 38 if (value >= BasicLevel.FATAL) { 39 return BasicLevel.LEVEL_FATAL; 40 } 41 else if (value >= BasicLevel.ERROR) { 42 return BasicLevel.LEVEL_ERROR; 43 } 44 else if (value >= BasicLevel.WARN) { 45 return BasicLevel.LEVEL_WARN; 46 } 47 else if (value >= BasicLevel.INFO) { 48 return BasicLevel.LEVEL_INFO; 49 } 50 else if (value >= BasicLevel.DEBUG) { 51 return BasicLevel.LEVEL_DEBUG; 52 } 53 else { 54 return BasicLevel.LEVEL_DEBUG; 55 } 56 } 57 58 public LevelImpl(String name, int val) { 59 super(name, val); 60 } 61 62 public LevelImpl(String name, String val, LevelFactory lf) { 63 super(name, val, lf); 64 } 65 66 } 67 | Popular Tags |