1 18 19 package org.apache.tools.ant.types; 20 21 import org.apache.tools.ant.Project; 22 23 26 public class LogLevel extends EnumeratedAttribute { 27 28 29 public static final LogLevel ERR = new LogLevel("error"); 30 31 32 public static final LogLevel WARN = new LogLevel("warn"); 33 34 35 public static final LogLevel INFO = new LogLevel("info"); 36 37 38 public static final LogLevel VERBOSE = new LogLevel("verbose"); 39 40 41 public static final LogLevel DEBUG = new LogLevel("debug"); 42 43 46 public LogLevel() { 47 } 48 49 private LogLevel(String value) { 50 this(); 51 setValue(value); 52 } 53 54 58 public String [] getValues() { 59 return new String [] { 60 "error", 61 "warn", 62 "warning", 63 "info", 64 "verbose", 65 "debug"}; 66 } 67 68 71 private static int[] levels = { 72 Project.MSG_ERR, 73 Project.MSG_WARN, 74 Project.MSG_WARN, 75 Project.MSG_INFO, 76 Project.MSG_VERBOSE, 77 Project.MSG_DEBUG 78 }; 79 80 84 public int getLevel() { 85 return levels[getIndex()]; 86 } 87 } 88 | Popular Tags |