001    package 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    
022    import java.io.PrintStream;
023    
024    import org.slf4j.Logger;
025    import org.slf4j.Marker;
026    
027    public class Slf4jStdoutLogger
028        implements Logger
029    {
030        private static final String ERROR = "[ERROR] ";
031    
032        private PrintStream out = System.out;
033    
034        //
035        // These are the only methods we need in our primordial logger
036        //    
037        public void error( String msg )
038        {
039            out.print( ERROR );
040            out.println( msg );
041        }
042    
043        public void error( String msg, Throwable t )
044        {
045            error( msg );
046    
047            if ( null != t )
048            {
049                t.printStackTrace( out );
050            }        
051        }    
052    
053        //
054        // Don't need any of this
055        //    
056        public String getName()
057        {
058            return null;
059        }
060    
061        public boolean isTraceEnabled()
062        {
063            return false;
064        }
065    
066        public void trace( String msg )
067        {
068        }
069    
070        public void trace( String format, Object arg )
071        {
072        }
073    
074        public void trace( String format, Object arg1, Object arg2 )
075        {
076        }
077    
078        public void trace( String format, Object... arguments )
079        {
080        }
081    
082        public void trace( String msg, Throwable t )
083        {
084        }
085    
086        public boolean isTraceEnabled( Marker marker )
087        {
088            return false;
089        }
090    
091        public void trace( Marker marker, String msg )
092        {
093        }
094    
095        public void trace( Marker marker, String format, Object arg )
096        {
097        }
098    
099        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    }