View Javadoc

1   package org.apache.maven.cli.logging;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.io.PrintStream;
23  
24  import org.slf4j.Logger;
25  import org.slf4j.Marker;
26  
27  public class Slf4jStdoutLogger
28      implements Logger
29  {
30      private static final String ERROR = "[ERROR] ";
31  
32      private PrintStream out = System.out;
33  
34      //
35      // These are the only methods we need in our primordial logger
36      //    
37      public void error( String msg )
38      {
39          out.print( ERROR );
40          out.println( msg );
41      }
42  
43      public void error( String msg, Throwable t )
44      {
45          error( msg );
46  
47          if ( null != t )
48          {
49              t.printStackTrace( out );
50          }        
51      }    
52  
53      //
54      // Don't need any of this
55      //    
56      public String getName()
57      {
58          return null;
59      }
60  
61      public boolean isTraceEnabled()
62      {
63          return false;
64      }
65  
66      public void trace( String msg )
67      {
68      }
69  
70      public void trace( String format, Object arg )
71      {
72      }
73  
74      public void trace( String format, Object arg1, Object arg2 )
75      {
76      }
77  
78      public void trace( String format, Object... arguments )
79      {
80      }
81  
82      public void trace( String msg, Throwable t )
83      {
84      }
85  
86      public boolean isTraceEnabled( Marker marker )
87      {
88          return false;
89      }
90  
91      public void trace( Marker marker, String msg )
92      {
93      }
94  
95      public void trace( Marker marker, String format, Object arg )
96      {
97      }
98  
99      public void trace( Marker marker, String format, Object arg1, Object arg2 )
100     {
101     }
102 
103     public void trace( Marker marker, String format, Object... argArray )
104     {
105     }
106 
107     public void trace( Marker marker, String msg, Throwable t )
108     {
109     }
110 
111     public boolean isDebugEnabled()
112     {
113         return false;
114     }
115 
116     public void debug( String msg )
117     {
118     }
119 
120     public void debug( String format, Object arg )
121     {
122     }
123 
124     public void debug( String format, Object arg1, Object arg2 )
125     {
126     }
127 
128     public void debug( String format, Object... arguments )
129     {
130     }
131 
132     public void debug( String msg, Throwable t )
133     {
134     }
135 
136     public boolean isDebugEnabled( Marker marker )
137     {
138         return false;
139     }
140 
141     public void debug( Marker marker, String msg )
142     {
143     }
144 
145     public void debug( Marker marker, String format, Object arg )
146     {
147     }
148 
149     public void debug( Marker marker, String format, Object arg1, Object arg2 )
150     {
151     }
152 
153     public void debug( Marker marker, String format, Object... arguments )
154     {
155     }
156 
157     public void debug( Marker marker, String msg, Throwable t )
158     {
159     }
160 
161     public boolean isInfoEnabled()
162     {
163         return false;
164     }
165 
166     public void info( String msg )
167     {
168     }
169 
170     public void info( String format, Object arg )
171     {
172     }
173 
174     public void info( String format, Object arg1, Object arg2 )
175     {
176     }
177 
178     public void info( String format, Object... arguments )
179     {
180     }
181 
182     public void info( String msg, Throwable t )
183     {
184     }
185 
186     public boolean isInfoEnabled( Marker marker )
187     {
188         return false;
189     }
190 
191     public void info( Marker marker, String msg )
192     {
193     }
194 
195     public void info( Marker marker, String format, Object arg )
196     {
197     }
198 
199     public void info( Marker marker, String format, Object arg1, Object arg2 )
200     {
201     }
202 
203     public void info( Marker marker, String format, Object... arguments )
204     {
205     }
206 
207     public void info( Marker marker, String msg, Throwable t )
208     {
209     }
210 
211     public boolean isWarnEnabled()
212     {
213         return false;
214     }
215 
216     public void warn( String msg )
217     {
218     }
219 
220     public void warn( String format, Object arg )
221     {
222     }
223 
224     public void warn( String format, Object... arguments )
225     {
226     }
227 
228     public void warn( String format, Object arg1, Object arg2 )
229     {
230     }
231 
232     public void warn( String msg, Throwable t )
233     {
234     }
235 
236     public boolean isWarnEnabled( Marker marker )
237     {
238         return false;
239     }
240 
241     public void warn( Marker marker, String msg )
242     {
243     }
244 
245     public void warn( Marker marker, String format, Object arg )
246     {
247     }
248 
249     public void warn( Marker marker, String format, Object arg1, Object arg2 )
250     {
251     }
252 
253     public void warn( Marker marker, String format, Object... arguments )
254     {
255     }
256 
257     public void warn( Marker marker, String msg, Throwable t )
258     {
259     }
260 
261     public boolean isErrorEnabled()
262     {
263         return false;
264     }
265 
266     public void error( String format, Object arg )
267     {
268     }
269 
270     public void error( String format, Object arg1, Object arg2 )
271     {
272     }
273 
274     public void error( String format, Object... arguments )
275     {
276     }
277 
278     public boolean isErrorEnabled( Marker marker )
279     {
280         return false;
281     }
282 
283     public void error( Marker marker, String msg )
284     {
285     }
286 
287     public void error( Marker marker, String format, Object arg )
288     {
289     }
290 
291     public void error( Marker marker, String format, Object arg1, Object arg2 )
292     {
293     }
294 
295     public void error( Marker marker, String format, Object... arguments )
296     {
297     }
298 
299     public void error( Marker marker, String msg, Throwable t )
300     {
301     }
302 
303 }