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   */
25  @Deprecated
26  public class DefaultLog
27      implements ScmLogger
28  {
29  
30      private boolean debug = false;
31  
32      public DefaultLog()
33      {
34          // no op
35      }
36  
37      public DefaultLog( boolean debug )
38      {
39          this.debug = debug;
40      }
41  
42      /**
43       * {@inheritDoc}
44       */
45      public boolean isDebugEnabled()
46      {
47          return this.debug;
48      }
49  
50      /**
51       * {@inheritDoc}
52       */
53      public void debug( String content )
54      {
55          if ( this.debug )
56          {
57              System.out.println( content );
58          }
59      }
60  
61      /**
62       * {@inheritDoc}
63       */
64      public void debug( String content, Throwable error )
65      {
66          if ( this.debug )
67          {
68              System.out.println( content );
69              error.printStackTrace();
70          }
71      }
72  
73      /**
74       * {@inheritDoc}
75       */
76      public void debug( Throwable error )
77      {
78          if ( this.debug )
79          {
80              error.printStackTrace();
81          }
82      }
83  
84      /**
85       * {@inheritDoc}
86       */
87      public boolean isInfoEnabled()
88      {
89          return true;
90      }
91  
92      /**
93       * {@inheritDoc}
94       */
95      public void info( String content )
96      {
97          System.out.println( content );
98      }
99  
100     /**
101      * {@inheritDoc}
102      */
103     public void info( String content, Throwable error )
104     {
105         System.out.println( content );
106         error.printStackTrace();
107     }
108 
109     /**
110      * {@inheritDoc}
111      */
112     public void info( Throwable error )
113     {
114         error.printStackTrace();
115     }
116 
117     /**
118      * {@inheritDoc}
119      */
120     public boolean isWarnEnabled()
121     {
122         return true;
123     }
124 
125     /**
126      * {@inheritDoc}
127      */
128     public void warn( String content )
129     {
130         System.out.println( content );
131     }
132 
133     /**
134      * {@inheritDoc}
135      */
136     public void warn( String content, Throwable error )
137     {
138         System.out.println( content );
139         error.printStackTrace();
140     }
141 
142     /**
143      * {@inheritDoc}
144      */
145     public void warn( Throwable error )
146     {
147         error.printStackTrace();
148     }
149 
150     /**
151      * {@inheritDoc}
152      */
153     public boolean isErrorEnabled()
154     {
155         return true;
156     }
157 
158     /**
159      * {@inheritDoc}
160      */
161     public void error( String content )
162     {
163         System.out.print( "[ERROR] " + content );
164     }
165 
166     /**
167      * {@inheritDoc}
168      */
169     public void error( String content, Throwable error )
170     {
171         System.out.println( "[ERROR] " + content );
172         error.printStackTrace();
173     }
174 
175     /**
176      * {@inheritDoc}
177      */
178     public void error( Throwable error )
179     {
180         error.printStackTrace();
181     }
182 }