001package org.apache.maven.cli.logging;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *  http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import java.io.PrintStream;
023
024import org.slf4j.Logger;
025import org.slf4j.Marker;
026
027/**
028 * @since 3.1.0
029 */
030public class Slf4jStdoutLogger
031    implements Logger
032{
033    private static final String ERROR = "[ERROR] ";
034
035    private PrintStream out = System.out;
036
037    //
038    // These are the only methods we need in our primordial logger
039    //    
040    public void error( String msg )
041    {
042        out.print( ERROR );
043        out.println( msg );
044    }
045
046    public void error( String msg, Throwable t )
047    {
048        error( msg );
049
050        if ( null != t )
051        {
052            t.printStackTrace( out );
053        }        
054    }    
055
056    //
057    // Don't need any of this
058    //    
059    public String getName()
060    {
061        return null;
062    }
063
064    public boolean isTraceEnabled()
065    {
066        return false;
067    }
068
069    public void trace( String msg )
070    {
071    }
072
073    public void trace( String format, Object arg )
074    {
075    }
076
077    public void trace( String format, Object arg1, Object arg2 )
078    {
079    }
080
081    public void trace( String format, Object... arguments )
082    {
083    }
084
085    public void trace( String msg, Throwable t )
086    {
087    }
088
089    public boolean isTraceEnabled( Marker marker )
090    {
091        return false;
092    }
093
094    public void trace( Marker marker, String msg )
095    {
096    }
097
098    public void trace( Marker marker, String format, Object arg )
099    {
100    }
101
102    public void trace( Marker marker, String format, Object arg1, Object arg2 )
103    {
104    }
105
106    public void trace( Marker marker, String format, Object... argArray )
107    {
108    }
109
110    public void trace( Marker marker, String msg, Throwable t )
111    {
112    }
113
114    public boolean isDebugEnabled()
115    {
116        return false;
117    }
118
119    public void debug( String msg )
120    {
121    }
122
123    public void debug( String format, Object arg )
124    {
125    }
126
127    public void debug( String format, Object arg1, Object arg2 )
128    {
129    }
130
131    public void debug( String format, Object... arguments )
132    {
133    }
134
135    public void debug( String msg, Throwable t )
136    {
137    }
138
139    public boolean isDebugEnabled( Marker marker )
140    {
141        return false;
142    }
143
144    public void debug( Marker marker, String msg )
145    {
146    }
147
148    public void debug( Marker marker, String format, Object arg )
149    {
150    }
151
152    public void debug( Marker marker, String format, Object arg1, Object arg2 )
153    {
154    }
155
156    public void debug( Marker marker, String format, Object... arguments )
157    {
158    }
159
160    public void debug( Marker marker, String msg, Throwable t )
161    {
162    }
163
164    public boolean isInfoEnabled()
165    {
166        return false;
167    }
168
169    public void info( String msg )
170    {
171    }
172
173    public void info( String format, Object arg )
174    {
175    }
176
177    public void info( String format, Object arg1, Object arg2 )
178    {
179    }
180
181    public void info( String format, Object... arguments )
182    {
183    }
184
185    public void info( String msg, Throwable t )
186    {
187    }
188
189    public boolean isInfoEnabled( Marker marker )
190    {
191        return false;
192    }
193
194    public void info( Marker marker, String msg )
195    {
196    }
197
198    public void info( Marker marker, String format, Object arg )
199    {
200    }
201
202    public void info( Marker marker, String format, Object arg1, Object arg2 )
203    {
204    }
205
206    public void info( Marker marker, String format, Object... arguments )
207    {
208    }
209
210    public void info( Marker marker, String msg, Throwable t )
211    {
212    }
213
214    public boolean isWarnEnabled()
215    {
216        return false;
217    }
218
219    public void warn( String msg )
220    {
221    }
222
223    public void warn( String format, Object arg )
224    {
225    }
226
227    public void warn( String format, Object... arguments )
228    {
229    }
230
231    public void warn( String format, Object arg1, Object arg2 )
232    {
233    }
234
235    public void warn( String msg, Throwable t )
236    {
237    }
238
239    public boolean isWarnEnabled( Marker marker )
240    {
241        return false;
242    }
243
244    public void warn( Marker marker, String msg )
245    {
246    }
247
248    public void warn( Marker marker, String format, Object arg )
249    {
250    }
251
252    public void warn( Marker marker, String format, Object arg1, Object arg2 )
253    {
254    }
255
256    public void warn( Marker marker, String format, Object... arguments )
257    {
258    }
259
260    public void warn( Marker marker, String msg, Throwable t )
261    {
262    }
263
264    public boolean isErrorEnabled()
265    {
266        return false;
267    }
268
269    public void error( String format, Object arg )
270    {
271    }
272
273    public void error( String format, Object arg1, Object arg2 )
274    {
275    }
276
277    public void error( String format, Object... arguments )
278    {
279    }
280
281    public boolean isErrorEnabled( Marker marker )
282    {
283        return false;
284    }
285
286    public void error( Marker marker, String msg )
287    {
288    }
289
290    public void error( Marker marker, String format, Object arg )
291    {
292    }
293
294    public void error( Marker marker, String format, Object arg1, Object arg2 )
295    {
296    }
297
298    public void error( Marker marker, String format, Object... arguments )
299    {
300    }
301
302    public void error( Marker marker, String msg, Throwable t )
303    {
304    }
305
306}