1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.velocity.internal.log; |
21 |
|
|
22 |
|
import org.apache.velocity.runtime.log.LogChute; |
23 |
|
import org.slf4j.Logger; |
24 |
|
|
25 |
|
|
26 |
|
@link |
27 |
|
|
28 |
|
@version |
29 |
|
@since |
30 |
|
|
|
|
| 47.4% |
Uncovered Elements: 30 (57) |
Complexity: 18 |
Complexity Density: 0.33 |
|
31 |
|
public abstract class AbstractSLF4JLogChute implements LogChute |
32 |
|
{ |
33 |
|
|
34 |
|
@return |
35 |
|
|
36 |
|
protected abstract Logger getLogger(); |
37 |
|
|
|
|
| 76.5% |
Uncovered Elements: 4 (17) |
Complexity: 6 |
Complexity Density: 0.35 |
|
38 |
3468 |
@Override... |
39 |
|
public void log(int level, String message) |
40 |
|
{ |
41 |
3468 |
switch (level) { |
42 |
21 |
case LogChute.WARN_ID: |
43 |
21 |
getLogger().warn(message); |
44 |
21 |
break; |
45 |
0 |
case LogChute.INFO_ID: |
46 |
0 |
getLogger().info(message); |
47 |
0 |
break; |
48 |
1019 |
case LogChute.TRACE_ID: |
49 |
1019 |
getLogger().trace(message); |
50 |
1019 |
break; |
51 |
28 |
case LogChute.ERROR_ID: |
52 |
28 |
getLogger().error(message); |
53 |
28 |
break; |
54 |
2400 |
case LogChute.DEBUG_ID: |
55 |
0 |
default: |
56 |
2400 |
getLogger().debug(message); |
57 |
2400 |
break; |
58 |
|
} |
59 |
|
} |
60 |
|
|
|
|
| 0% |
Uncovered Elements: 17 (17) |
Complexity: 6 |
Complexity Density: 0.35 |
|
61 |
0 |
@Override... |
62 |
|
public void log(int level, String message, Throwable t) |
63 |
|
{ |
64 |
0 |
switch (level) { |
65 |
0 |
case LogChute.WARN_ID: |
66 |
0 |
getLogger().warn(message, t); |
67 |
0 |
break; |
68 |
0 |
case LogChute.INFO_ID: |
69 |
0 |
getLogger().info(message, t); |
70 |
0 |
break; |
71 |
0 |
case LogChute.TRACE_ID: |
72 |
0 |
getLogger().trace(message, t); |
73 |
0 |
break; |
74 |
0 |
case LogChute.ERROR_ID: |
75 |
0 |
getLogger().error(message, t); |
76 |
0 |
break; |
77 |
0 |
case LogChute.DEBUG_ID: |
78 |
0 |
default: |
79 |
0 |
getLogger().debug(message, t); |
80 |
0 |
break; |
81 |
|
} |
82 |
|
} |
83 |
|
|
|
|
| 60% |
Uncovered Elements: 8 (20) |
Complexity: 6 |
Complexity Density: 0.3 |
|
84 |
267882 |
@Override... |
85 |
|
public boolean isLevelEnabled(int level) |
86 |
|
{ |
87 |
267882 |
boolean islevelEnabled; |
88 |
|
|
89 |
267882 |
switch (level) { |
90 |
214165 |
case LogChute.DEBUG_ID: |
91 |
214167 |
islevelEnabled = getLogger().isDebugEnabled(); |
92 |
214165 |
break; |
93 |
0 |
case LogChute.INFO_ID: |
94 |
0 |
islevelEnabled = getLogger().isInfoEnabled(); |
95 |
0 |
break; |
96 |
78 |
case LogChute.TRACE_ID: |
97 |
78 |
islevelEnabled = getLogger().isTraceEnabled(); |
98 |
78 |
break; |
99 |
53630 |
case LogChute.WARN_ID: |
100 |
53627 |
islevelEnabled = getLogger().isWarnEnabled(); |
101 |
53627 |
break; |
102 |
0 |
case LogChute.ERROR_ID: |
103 |
0 |
islevelEnabled = getLogger().isErrorEnabled(); |
104 |
0 |
break; |
105 |
0 |
default: |
106 |
0 |
islevelEnabled = true; |
107 |
|
} |
108 |
|
|
109 |
267870 |
return islevelEnabled; |
110 |
|
} |
111 |
|
} |