-
Notifications
You must be signed in to change notification settings - Fork 0
/
Log.java
43 lines (35 loc) · 947 Bytes
/
Log.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Created on 2003/07/13
* $Id: Log.java,v 1.1 2004/01/18 18:02:52 matsu Exp $
*
*/
/**
* コンソール出力
* Log4Jみたいなことをやってる
*
* @author Yuki Matsukura <[email protected]>
*/
public class Log {
private static final int DEBUG = 0;
private static final int INFO = 1;
private static final int WARN = 2;
private static final int FATAL = 3;
/** Log output level */
private static int mode = 1;
public static void debug(Object message) {
if(mode == 0 )
System.out.println("DEBUG: "+message);
}
public static void info(Object message) {
if(mode <= 1)
System.out.println("INFO: "+message);
}
public static void warn(Object message) {
if(mode <= 2)
System.out.println("WARN: "+message);
}
public static void fatal(Object message) {
if(mode <= 3)
System.out.println("FATAL: "+message);
}
}