View Javadoc

1   package org.apache.maven.scm.log;
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  /**
23   * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
24   * @version $Id: DefaultLog.java 685539 2008-08-13 13:27:27Z vsiveton $
25   */
26  public class DefaultLog
27      implements ScmLogger
28  {
29  
30      /** {@inheritDoc} */
31      public boolean isDebugEnabled()
32      {
33          return false;
34      }
35  
36      /** {@inheritDoc} */
37      public void debug( String content )
38      {
39      }
40  
41      /** {@inheritDoc} */
42      public void debug( String content, Throwable error )
43      {
44      }
45  
46      /** {@inheritDoc} */
47      public void debug( Throwable error )
48      {
49      }
50  
51      /** {@inheritDoc} */
52      public boolean isInfoEnabled()
53      {
54          return true;
55      }
56  
57      /** {@inheritDoc} */
58      public void info( String content )
59      {
60          System.out.println( content );
61      }
62  
63      /** {@inheritDoc} */
64      public void info( String content, Throwable error )
65      {
66          System.out.println( content );
67          error.printStackTrace();
68      }
69  
70      /** {@inheritDoc} */
71      public void info( Throwable error )
72      {
73          error.printStackTrace();
74      }
75  
76      /** {@inheritDoc} */
77      public boolean isWarnEnabled()
78      {
79          return true;
80      }
81  
82      /** {@inheritDoc} */
83      public void warn( String content )
84      {
85          System.out.println( content );
86      }
87  
88      /** {@inheritDoc} */
89      public void warn( String content, Throwable error )
90      {
91          System.out.println( content );
92          error.printStackTrace();
93      }
94  
95      /** {@inheritDoc} */
96      public void warn( Throwable error )
97      {
98          error.printStackTrace();
99      }
100 
101     /** {@inheritDoc} */
102     public boolean isErrorEnabled()
103     {
104         return true;
105     }
106 
107     /** {@inheritDoc} */
108     public void error( String content )
109     {
110         System.out.print( "[ERROR] " + content );
111     }
112 
113     /** {@inheritDoc} */
114     public void error( String content, Throwable error )
115     {
116         System.out.println( "[ERROR] " + content );
117         error.printStackTrace();
118     }
119 
120     /** {@inheritDoc} */
121     public void error( Throwable error )
122     {
123         error.printStackTrace();
124     }
125 }