|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| |
|
18 |
| package org.qedeq.kernel.log; |
|
19 |
| |
|
20 |
| import org.apache.commons.logging.Log; |
|
21 |
| import org.apache.commons.logging.LogFactory; |
|
22 |
| |
|
23 |
| |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
| |
|
30 |
| public final class Trace { |
|
31 |
| |
|
32 |
| |
|
33 |
| |
|
34 |
| |
|
35 |
0
| private Trace() {
|
|
36 |
| |
|
37 |
| } |
|
38 |
| |
|
39 |
| |
|
40 |
| |
|
41 |
| |
|
42 |
| |
|
43 |
| |
|
44 |
| |
|
45 |
| |
|
46 |
285389
| public static void trace(final Object tracingObject, final String method,
|
|
47 |
| final Object object) { |
|
48 |
285389
| final Log log = LogFactory.getFactory().getInstance(tracingObject.getClass()
|
|
49 |
| + "." + method); |
|
50 |
285389
| log.debug(object);
|
|
51 |
| } |
|
52 |
| |
|
53 |
| |
|
54 |
| |
|
55 |
| |
|
56 |
| |
|
57 |
| |
|
58 |
| |
|
59 |
| |
|
60 |
6615
| public static void trace(final Class tracingClass, final String method,
|
|
61 |
| final Object object) { |
|
62 |
6615
| final Log log = LogFactory.getFactory().getInstance(tracingClass
|
|
63 |
| + "." + method); |
|
64 |
6615
| log.debug(method + ":" + object);
|
|
65 |
| } |
|
66 |
| |
|
67 |
| |
|
68 |
| |
|
69 |
| |
|
70 |
| |
|
71 |
| |
|
72 |
| |
|
73 |
| |
|
74 |
1
| public static void trace(final Object tracingObject, final String method,
|
|
75 |
| final Throwable throwable) { |
|
76 |
1
| final Log log = LogFactory.getFactory().getInstance(tracingObject.getClass()
|
|
77 |
| + "." + method); |
|
78 |
1
| log.debug(throwable, throwable);
|
|
79 |
| } |
|
80 |
| |
|
81 |
| |
|
82 |
| |
|
83 |
| |
|
84 |
| |
|
85 |
| |
|
86 |
| |
|
87 |
| |
|
88 |
0
| public static void trace(final Class tracingClass, final String method,
|
|
89 |
| final Throwable throwable) { |
|
90 |
0
| final Log log = LogFactory.getFactory().getInstance(tracingClass
|
|
91 |
| + "." + method); |
|
92 |
0
| log.debug(throwable, throwable);
|
|
93 |
| |
|
94 |
| |
|
95 |
| |
|
96 |
| } |
|
97 |
| |
|
98 |
| |
|
99 |
| |
|
100 |
| |
|
101 |
| |
|
102 |
| |
|
103 |
| |
|
104 |
| |
|
105 |
| |
|
106 |
0
| public static void trace(final Object tracingObject, final String method,
|
|
107 |
| final String description, final Throwable throwable) { |
|
108 |
0
| final Log log = LogFactory.getFactory().getInstance(tracingObject.getClass()
|
|
109 |
| + "." + method); |
|
110 |
0
| log.debug(description, throwable);
|
|
111 |
| } |
|
112 |
| |
|
113 |
| |
|
114 |
| |
|
115 |
| |
|
116 |
| |
|
117 |
| |
|
118 |
| |
|
119 |
| |
|
120 |
| |
|
121 |
0
| public static void trace(final Class tracingClass, final String method,
|
|
122 |
| final String description, final Throwable throwable) { |
|
123 |
0
| final Log log = LogFactory.getFactory().getInstance(tracingClass
|
|
124 |
| + "." + method); |
|
125 |
0
| log.debug(description, throwable);
|
|
126 |
| } |
|
127 |
| |
|
128 |
| |
|
129 |
| |
|
130 |
| |
|
131 |
| |
|
132 |
| |
|
133 |
| |
|
134 |
| |
|
135 |
12449
| public static void begin(final Object tracingObject, final String method) {
|
|
136 |
12449
| trace(tracingObject, method, "begin");
|
|
137 |
| } |
|
138 |
| |
|
139 |
| |
|
140 |
| |
|
141 |
| |
|
142 |
| |
|
143 |
| |
|
144 |
| |
|
145 |
92
| public static void begin(final Class tracingClass, final String method) {
|
|
146 |
92
| trace(tracingClass, method, "begin");
|
|
147 |
| } |
|
148 |
| |
|
149 |
| |
|
150 |
| |
|
151 |
| |
|
152 |
| |
|
153 |
| |
|
154 |
| |
|
155 |
12280
| public static void end(final Object tracingObject, final String method) {
|
|
156 |
12280
| trace(tracingObject, method, "end");
|
|
157 |
| } |
|
158 |
| |
|
159 |
| |
|
160 |
| |
|
161 |
| |
|
162 |
| |
|
163 |
| |
|
164 |
| |
|
165 |
92
| public static void end(final Class tracingClass, final String method) {
|
|
166 |
92
| trace(tracingClass, method, "end");
|
|
167 |
| } |
|
168 |
| |
|
169 |
| |
|
170 |
| |
|
171 |
| |
|
172 |
| |
|
173 |
| |
|
174 |
| |
|
175 |
| |
|
176 |
| |
|
177 |
248349
| public static void param(final Object tracingObject, final String method,
|
|
178 |
| final String param, final Object value) { |
|
179 |
248349
| trace(tracingObject, method, param + "=" + value);
|
|
180 |
| } |
|
181 |
| |
|
182 |
| |
|
183 |
| |
|
184 |
| |
|
185 |
| |
|
186 |
| |
|
187 |
| |
|
188 |
| |
|
189 |
| |
|
190 |
6431
| public static void param(final Class tracingClass, final String method,
|
|
191 |
| final String param, final Object value) { |
|
192 |
6431
| trace(tracingClass, method, param + "=" + value);
|
|
193 |
| } |
|
194 |
| |
|
195 |
| |
|
196 |
| |
|
197 |
| |
|
198 |
| |
|
199 |
| |
|
200 |
| |
|
201 |
| |
|
202 |
| |
|
203 |
0
| public static void param(final Object tracingObject, final String method,
|
|
204 |
| final String param, final int value) { |
|
205 |
0
| trace(tracingObject, method, param + "=" + value);
|
|
206 |
| } |
|
207 |
| |
|
208 |
| |
|
209 |
| |
|
210 |
| |
|
211 |
| |
|
212 |
| |
|
213 |
| |
|
214 |
| |
|
215 |
| |
|
216 |
0
| public static void param(final Class tracingClass, final String method,
|
|
217 |
| final String param, final int value) { |
|
218 |
0
| trace(tracingClass, method, param + "=" + value);
|
|
219 |
| } |
|
220 |
| |
|
221 |
| |
|
222 |
| |
|
223 |
| |
|
224 |
| |
|
225 |
| |
|
226 |
| |
|
227 |
0
| public static void traceStack(final Object tracingObject, final String method) {
|
|
228 |
0
| try {
|
|
229 |
0
| throw new Exception("Stacktrace");
|
|
230 |
| } catch (Exception e) { |
|
231 |
0
| trace(tracingObject, method, e);
|
|
232 |
| } |
|
233 |
| } |
|
234 |
| |
|
235 |
| |
|
236 |
| |
|
237 |
| |
|
238 |
| |
|
239 |
| |
|
240 |
| |
|
241 |
0
| public static final void traceStack(final Class tracingClass, final String method) {
|
|
242 |
0
| try {
|
|
243 |
0
| throw new Exception("Stacktrace");
|
|
244 |
| } catch (Exception e) { |
|
245 |
0
| trace(tracingClass, method, e);
|
|
246 |
| } |
|
247 |
| } |
|
248 |
| |
|
249 |
| } |