Added README file
[metux-java.git] / log / LoglevelID.java
blobceea9f92eb9fb9a9da9d8e157f172287de72bcd0
2 package org.de.metux.log;
4 public class LoglevelID
6 public static final int DEBUG = 5;
7 public static final int NOTICE = 4;
8 public static final int WARNING = 3;
9 public static final int ERROR = 2;
10 public static final int NONE = 0;
12 public static int toID(String name)
14 return toID(name,NOTICE);
17 public static int toID(String name, int def)
19 if (name==null)
20 return def;
22 name = name.toLowerCase();
23 if (name.equals("debug"))
24 return DEBUG;
25 if (name.equals("notice"))
26 return NOTICE;
27 if (name.equals("warning"))
28 return WARNING;
29 if (name.equals("error"))
30 return ERROR;
32 return def;