| 5827 |
amar.kumar |
1 |
/*
|
|
|
2 |
* Copyright 2005 stat4j.org
|
|
|
3 |
*
|
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
|
6 |
* You may obtain a copy of the License at
|
|
|
7 |
*
|
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
9 |
*
|
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13 |
* See the License for the specific language governing permissions and
|
|
|
14 |
* limitations under the License.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
package net.sourceforge.stat4j.util;
|
|
|
18 |
|
|
|
19 |
import org.apache.log4j.Category;
|
|
|
20 |
|
|
|
21 |
/**
|
|
|
22 |
* Name: Log.java
|
|
|
23 |
* Date: Sep 4, 2004
|
|
|
24 |
* Description:
|
|
|
25 |
*
|
|
|
26 |
*
|
|
|
27 |
* @author Lara D'Abreo
|
|
|
28 |
*/
|
|
|
29 |
public class Log {
|
|
|
30 |
|
|
|
31 |
public static final Category category = Category.getInstance(Util.getCategory());
|
|
|
32 |
|
|
|
33 |
public static void debug(Object message) {
|
|
|
34 |
category.debug(message);
|
|
|
35 |
}
|
|
|
36 |
|
|
|
37 |
public static void debug(Object message, Throwable t) {
|
|
|
38 |
|
|
|
39 |
category.debug(message, t);
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
public static void error(Object message) {
|
|
|
43 |
category.error(message);
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
public static void error(Object message, Throwable t) {
|
|
|
47 |
category.error(message, t);
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
public static void fatal(Object message) {
|
|
|
51 |
category.fatal(message);
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
public static void fatal(Object message, Throwable t) {
|
|
|
55 |
category.fatal(message, t);
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
public static void info(Object message) {
|
|
|
59 |
category.info(message);
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
public static void info(Object message, Throwable t) {
|
|
|
63 |
category.info(message, t);
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
public static void warn(Object message) {
|
|
|
67 |
category.warn(message);
|
|
|
68 |
}
|
|
|
69 |
|
|
|
70 |
public static void warn(String category,Object message) {
|
|
|
71 |
Category c = Category.getInstance(category);
|
|
|
72 |
c.warn(message);
|
|
|
73 |
}
|
|
|
74 |
|
|
|
75 |
public static void error(String category,Object message) {
|
|
|
76 |
Category c = Category.getInstance(category);
|
|
|
77 |
c.error(message);
|
|
|
78 |
}
|
|
|
79 |
|
|
|
80 |
public static void warn(Object message, Throwable t) {
|
|
|
81 |
category.warn(message, t);
|
|
|
82 |
}
|
|
|
83 |
|
|
|
84 |
public static boolean isDebugEnabled() {
|
|
|
85 |
return category.isDebugEnabled();
|
|
|
86 |
}
|
|
|
87 |
|
|
|
88 |
}
|