1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.cli.logging;
20
21 import java.io.PrintStream;
22
23 import org.slf4j.Logger;
24 import org.slf4j.Marker;
25
26 import static java.util.Objects.requireNonNull;
27
28
29
30
31 public class Slf4jStdoutLogger implements Logger {
32 private static final String ERROR = "[ERROR] ";
33
34 private final PrintStream out;
35
36 public Slf4jStdoutLogger() {
37 this(System.out);
38 }
39
40 public Slf4jStdoutLogger(PrintStream out) {
41 this.out = requireNonNull(out);
42 }
43
44
45
46
47 public void error(String msg) {
48 out.print(ERROR);
49 out.println(msg);
50 }
51
52 public void error(String msg, Throwable t) {
53 error(msg);
54
55 if (null != t) {
56 t.printStackTrace(out);
57 }
58 }
59
60
61
62
63 public String getName() {
64 return null;
65 }
66
67 public boolean isTraceEnabled() {
68 return false;
69 }
70
71 public void trace(String msg) {}
72
73 public void trace(String format, Object arg) {}
74
75 public void trace(String format, Object arg1, Object arg2) {}
76
77 public void trace(String format, Object... arguments) {}
78
79 public void trace(String msg, Throwable t) {}
80
81 public boolean isTraceEnabled(Marker marker) {
82 return false;
83 }
84
85 public void trace(Marker marker, String msg) {}
86
87 public void trace(Marker marker, String format, Object arg) {}
88
89 public void trace(Marker marker, String format, Object arg1, Object arg2) {}
90
91 public void trace(Marker marker, String format, Object... argArray) {}
92
93 public void trace(Marker marker, String msg, Throwable t) {}
94
95 public boolean isDebugEnabled() {
96 return false;
97 }
98
99 public void debug(String msg) {}
100
101 public void debug(String format, Object arg) {}
102
103 public void debug(String format, Object arg1, Object arg2) {}
104
105 public void debug(String format, Object... arguments) {}
106
107 public void debug(String msg, Throwable t) {}
108
109 public boolean isDebugEnabled(Marker marker) {
110 return false;
111 }
112
113 public void debug(Marker marker, String msg) {}
114
115 public void debug(Marker marker, String format, Object arg) {}
116
117 public void debug(Marker marker, String format, Object arg1, Object arg2) {}
118
119 public void debug(Marker marker, String format, Object... arguments) {}
120
121 public void debug(Marker marker, String msg, Throwable t) {}
122
123 public boolean isInfoEnabled() {
124 return false;
125 }
126
127 public void info(String msg) {}
128
129 public void info(String format, Object arg) {}
130
131 public void info(String format, Object arg1, Object arg2) {}
132
133 public void info(String format, Object... arguments) {}
134
135 public void info(String msg, Throwable t) {}
136
137 public boolean isInfoEnabled(Marker marker) {
138 return false;
139 }
140
141 public void info(Marker marker, String msg) {}
142
143 public void info(Marker marker, String format, Object arg) {}
144
145 public void info(Marker marker, String format, Object arg1, Object arg2) {}
146
147 public void info(Marker marker, String format, Object... arguments) {}
148
149 public void info(Marker marker, String msg, Throwable t) {}
150
151 public boolean isWarnEnabled() {
152 return false;
153 }
154
155 public void warn(String msg) {}
156
157 public void warn(String format, Object arg) {}
158
159 public void warn(String format, Object... arguments) {}
160
161 public void warn(String format, Object arg1, Object arg2) {}
162
163 public void warn(String msg, Throwable t) {}
164
165 public boolean isWarnEnabled(Marker marker) {
166 return false;
167 }
168
169 public void warn(Marker marker, String msg) {}
170
171 public void warn(Marker marker, String format, Object arg) {}
172
173 public void warn(Marker marker, String format, Object arg1, Object arg2) {}
174
175 public void warn(Marker marker, String format, Object... arguments) {}
176
177 public void warn(Marker marker, String msg, Throwable t) {}
178
179 public boolean isErrorEnabled() {
180 return false;
181 }
182
183 public void error(String format, Object arg) {}
184
185 public void error(String format, Object arg1, Object arg2) {}
186
187 public void error(String format, Object... arguments) {}
188
189 public boolean isErrorEnabled(Marker marker) {
190 return false;
191 }
192
193 public void error(Marker marker, String msg) {}
194
195 public void error(Marker marker, String format, Object arg) {}
196
197 public void error(Marker marker, String format, Object arg1, Object arg2) {}
198
199 public void error(Marker marker, String format, Object... arguments) {}
200
201 public void error(Marker marker, String msg, Throwable t) {}
202 }