View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.plugins.dependency.utils;
20  
21  import org.apache.maven.plugin.logging.Log;
22  import org.codehaus.plexus.logging.Logger;
23  
24  /**
25   * This logger implements both types of logs currently in use and turns off logs.
26   *
27   * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
28   */
29  public class DependencySilentLog implements Log, Logger {
30      /**
31       * @return <code>false</code>
32       * @see org.apache.maven.plugin.logging.Log#isDebugEnabled()
33       */
34      @Override
35      public boolean isDebugEnabled() {
36          return false;
37      }
38  
39      /**
40       * By default, do nothing.
41       *
42       * @see org.apache.maven.plugin.logging.Log#debug(java.lang.CharSequence)
43       */
44      @Override
45      public void debug(CharSequence content) {
46          // nop
47      }
48  
49      /**
50       * By default, do nothing.
51       *
52       * @see org.apache.maven.plugin.logging.Log#debug(java.lang.CharSequence, java.lang.Throwable)
53       */
54      @Override
55      public void debug(CharSequence content, Throwable error) {
56          // nop
57      }
58  
59      /**
60       * By default, do nothing.
61       *
62       * @see org.apache.maven.plugin.logging.Log#debug(java.lang.Throwable)
63       */
64      @Override
65      public void debug(Throwable error) {
66          // nop
67      }
68  
69      /**
70       * @return <code>false</code>
71       * @see org.apache.maven.plugin.logging.Log#isInfoEnabled()
72       */
73      @Override
74      public boolean isInfoEnabled() {
75          return false;
76      }
77  
78      /**
79       * By default, do nothing.
80       *
81       * @see org.apache.maven.plugin.logging.Log#info(java.lang.CharSequence)
82       */
83      @Override
84      public void info(CharSequence content) {
85          // nop
86      }
87  
88      /**
89       * By default, do nothing.
90       *
91       * @see org.apache.maven.plugin.logging.Log#info(java.lang.CharSequence, java.lang.Throwable)
92       */
93      @Override
94      public void info(CharSequence content, Throwable error) {
95          // nop
96      }
97  
98      /**
99       * By default, do nothing.
100      *
101      * @see org.apache.maven.plugin.logging.Log#info(java.lang.Throwable)
102      */
103     @Override
104     public void info(Throwable error) {
105         // nop
106     }
107 
108     /**
109      * By default, do nothing.
110      *
111      * @see org.apache.maven.plugin.logging.Log#isWarnEnabled()
112      */
113     @Override
114     public boolean isWarnEnabled() {
115         // nop
116         return false;
117     }
118 
119     /**
120      * By default, do nothing.
121      *
122      * @see org.apache.maven.plugin.logging.Log#warn(java.lang.CharSequence)
123      */
124     @Override
125     public void warn(CharSequence content) {
126         // nop
127     }
128 
129     /**
130      * By default, do nothing.
131      *
132      * @see org.apache.maven.plugin.logging.Log#warn(java.lang.CharSequence, java.lang.Throwable)
133      */
134     @Override
135     public void warn(CharSequence content, Throwable error) {
136         // nop
137     }
138 
139     /**
140      * By default, do nothing.
141      *
142      * @see org.apache.maven.plugin.logging.Log#warn(java.lang.Throwable)
143      */
144     @Override
145     public void warn(Throwable error) {
146         // nop
147     }
148 
149     /**
150      * @return <code>false</code>
151      * @see org.apache.maven.plugin.logging.Log#isErrorEnabled()
152      */
153     @Override
154     public boolean isErrorEnabled() {
155         return false;
156     }
157 
158     /**
159      * By default, do nothing.
160      *
161      * @see org.apache.maven.plugin.logging.Log#error(java.lang.CharSequence)
162      */
163     @Override
164     public void error(CharSequence content) {
165         // nop
166     }
167 
168     /**
169      * By default, do nothing.
170      *
171      * @see org.apache.maven.plugin.logging.Log#error(java.lang.CharSequence, java.lang.Throwable)
172      */
173     @Override
174     public void error(CharSequence content, Throwable error) {
175         // nop
176     }
177 
178     /**
179      * By default, do nothing.
180      *
181      * @see org.apache.maven.plugin.logging.Log#error(java.lang.Throwable)
182      */
183     @Override
184     public void error(Throwable error) {
185         // nop
186     }
187 
188     /**
189      * By default, do nothing.
190      *
191      * @see org.codehaus.plexus.logging.Logger#debug(java.lang.String)
192      */
193     @Override
194     public void debug(String message) {
195         // nop
196     }
197 
198     /**
199      * By default, do nothing.
200      *
201      * @see org.codehaus.plexus.logging.Logger#debug(java.lang.String, java.lang.Throwable)
202      */
203     @Override
204     public void debug(String message, Throwable throwable) {
205         // nop
206     }
207 
208     /**
209      * By default, do nothing.
210      *
211      * @see org.codehaus.plexus.logging.Logger#info(java.lang.String)
212      */
213     @Override
214     public void info(String message) {
215         // nop
216     }
217 
218     /**
219      * By default, do nothing.
220      *
221      * @see org.codehaus.plexus.logging.Logger#info(java.lang.String, java.lang.Throwable)
222      */
223     @Override
224     public void info(String message, Throwable throwable) {
225         // nop
226     }
227 
228     /**
229      * By default, do nothing.
230      *
231      * @see org.codehaus.plexus.logging.Logger#warn(java.lang.String)
232      */
233     @Override
234     public void warn(String message) {
235         // nop
236     }
237 
238     /**
239      * By default, do nothing.
240      *
241      * @see org.codehaus.plexus.logging.Logger#warn(java.lang.String, java.lang.Throwable)
242      */
243     @Override
244     public void warn(String message, Throwable throwable) {
245         // nop
246     }
247 
248     /**
249      * By default, do nothing.
250      *
251      * @see org.codehaus.plexus.logging.Logger#error(java.lang.String)
252      */
253     @Override
254     public void error(String message) {
255         // nop
256     }
257 
258     /**
259      * By default, do nothing.
260      *
261      * @see org.codehaus.plexus.logging.Logger#error(java.lang.String, java.lang.Throwable)
262      */
263     @Override
264     public void error(String message, Throwable throwable) {
265         // nop
266     }
267 
268     /**
269      * By default, do nothing.
270      *
271      * @see org.codehaus.plexus.logging.Logger#fatalError(java.lang.String)
272      */
273     @Override
274     public void fatalError(String message) {
275         // nop
276     }
277 
278     /**
279      * By default, do nothing.
280      *
281      * @see org.codehaus.plexus.logging.Logger#fatalError(java.lang.String, java.lang.Throwable)
282      */
283     @Override
284     public void fatalError(String message, Throwable throwable) {
285         // nop
286     }
287 
288     /**
289      * @return <code>false</code>
290      * @see org.codehaus.plexus.logging.Logger#isFatalErrorEnabled()
291      */
292     @Override
293     public boolean isFatalErrorEnabled() {
294         return false;
295     }
296 
297     /**
298      * @return <code>null</code>
299      * @see org.codehaus.plexus.logging.Logger#getChildLogger(java.lang.String)
300      */
301     @Override
302     public Logger getChildLogger(String name) {
303         return null;
304     }
305 
306     /**
307      * @return <code>0</code>
308      * @see org.codehaus.plexus.logging.Logger#getThreshold()
309      */
310     @Override
311     public int getThreshold() {
312         return 0;
313     }
314 
315     /**
316      * By default, do nothing
317      */
318     @Override
319     public void setThreshold(int threshold) {
320         // nop
321     }
322 
323     /**
324      * @return <code>null</code>
325      * @see org.codehaus.plexus.logging.Logger#getName()
326      */
327     @Override
328     public String getName() {
329         return null;
330     }
331 }