1 |
|
package org.codehaus.mojo.exec; |
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
import java.io.PrintStream; |
23 |
|
import org.apache.maven.plugin.logging.Log; |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
|
|
| 0% |
Uncovered Elements: 70 (70) |
Complexity: 29 |
Complexity Density: 0.91 |
|
28 |
|
class StreamLog implements Log { |
29 |
|
static final int DEBUG = 0; |
30 |
|
static final int INFO = 1; |
31 |
|
static final int WARN = 2; |
32 |
|
static final int ERROR = 3; |
33 |
|
|
34 |
|
private int level = INFO; |
35 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
36 |
0
|
public void setLevel(int level) {... |
37 |
0
|
if (level < DEBUG || level > ERROR) { |
38 |
0
|
throw new IllegalStateException("invalid level: " + level); |
39 |
|
} |
40 |
0
|
this.level = level; |
41 |
|
} |
42 |
|
|
43 |
|
private final PrintStream s; |
44 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
45 |
0
|
StreamLog(PrintStream s) {... |
46 |
0
|
this.s = s; |
47 |
|
} |
48 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
49 |
0
|
public void debug(CharSequence content) {... |
50 |
0
|
if (isDebugEnabled()) { |
51 |
0
|
s.println(content); |
52 |
|
} |
53 |
|
} |
54 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
55 |
0
|
public void debug(CharSequence content, Throwable error) {... |
56 |
0
|
if (isDebugEnabled()) { |
57 |
0
|
s.println(content); |
58 |
|
} |
59 |
|
} |
60 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
61 |
0
|
public void debug(Throwable error) {... |
62 |
0
|
if (isDebugEnabled()) { |
63 |
0
|
error.printStackTrace(s); |
64 |
|
} |
65 |
|
} |
66 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
67 |
0
|
public void error(CharSequence content) {... |
68 |
0
|
if (isErrorEnabled()) { |
69 |
0
|
s.println(content); |
70 |
|
} |
71 |
|
} |
72 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
73 |
0
|
public void error(CharSequence content, Throwable error) {... |
74 |
0
|
error(content); |
75 |
0
|
error(error); |
76 |
|
} |
77 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
78 |
0
|
public void error(Throwable error) {... |
79 |
0
|
if (isErrorEnabled()) { |
80 |
0
|
error.printStackTrace(s); |
81 |
|
} |
82 |
|
} |
83 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
84 |
0
|
public void info(CharSequence content) {... |
85 |
0
|
if (isInfoEnabled()) { |
86 |
0
|
s.println(content); |
87 |
|
} |
88 |
|
} |
89 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
90 |
0
|
public void info(CharSequence content, Throwable error) {... |
91 |
0
|
info(content); |
92 |
0
|
info(error); |
93 |
|
} |
94 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
95 |
0
|
public void info(Throwable error) {... |
96 |
0
|
if (isInfoEnabled()) { |
97 |
0
|
error.printStackTrace(s); |
98 |
|
} |
99 |
|
} |
100 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
101 |
0
|
public boolean isDebugEnabled() {... |
102 |
0
|
return level >= DEBUG; |
103 |
|
} |
104 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
105 |
0
|
public boolean isErrorEnabled() {... |
106 |
0
|
return level >= ERROR; |
107 |
|
} |
108 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
109 |
0
|
public boolean isInfoEnabled() {... |
110 |
0
|
return level >= INFO; |
111 |
|
} |
112 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
113 |
0
|
public boolean isWarnEnabled() {... |
114 |
0
|
return level >= WARN; |
115 |
|
} |
116 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
117 |
0
|
public void warn(CharSequence content) {... |
118 |
0
|
if (isWarnEnabled()) { |
119 |
0
|
s.println(content); |
120 |
|
} |
121 |
|
} |
122 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
123 |
0
|
public void warn(CharSequence content, Throwable error) {... |
124 |
0
|
warn(content); |
125 |
0
|
warn(error); |
126 |
|
} |
127 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
128 |
0
|
public void warn(Throwable error) {... |
129 |
0
|
if (isWarnEnabled()) { |
130 |
0
|
error.printStackTrace(s); |
131 |
|
} |
132 |
|
} |
133 |
|
} |