imported from svn
[metux-java.git] / log / LoggerTerm.java
blob5d0a1cba95c5a36479832ca9defe503d0956eae1
2 package org.de.metux.log;
4 import org.de.metux.util.Terminal;
6 public class LoggerTerm implements ILogger
8 public int loglevel = LoglevelID.DEBUG;
10 final public void setLogLevel(int ll)
12 loglevel = ll;
15 final public void error(String stage, String message)
17 if (loglevel >= LoglevelID.ERROR)
18 System.err.println(
19 Terminal.render(
20 "{TERM_FG_RED} (ERROR) [{TERM_FG_BLUE}"+
21 stage+
22 "{TERM_FG_RED}] {TERM_FG_YELLOW}"+
23 message+
24 "{TERM_NORMAL} "
25 ));
28 final public void warning(String stage, String message)
30 if (loglevel >= LoglevelID.WARNING)
31 System.err.println(
32 Terminal.render(
33 "{TERM_FG_CYAN} (WARN) [{TERM_FG_BLUE}"+
34 stage+
35 "{TERM_FG_CYAN}] "+
36 message+
37 "{TERM_NORMAL} "
38 ));
41 final public void debug(String stage, String message)
43 if (loglevel >= LoglevelID.DEBUG)
44 System.err.println(
45 Terminal.render(
46 "{TERM_FG_YELLOW} (DEBUG) [{TERM_FG_BLUE}"+
47 stage+
48 "{TERM_FG_YELLOW}] {TERM_NORMAL}"+
49 message+
50 "{TERM_NORMAL} "
51 ));
54 final public void notice(String stage, String message)
56 if (loglevel >= LoglevelID.NOTICE)
57 System.err.println(
58 Terminal.render(
59 "{TERM_FG_GREEN}(NOTICE) [{TERM_FG_BLUE}"+
60 stage+
61 "{TERM_FG_GREEN}] {TERM_FG_YELLOW}"+
62 message+
63 "{TERM_NORMAL} "
64 ));