001package org.apache.maven.scm.log; 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/** 023 * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a> 024 */ 025@Deprecated 026public class DefaultLog 027 implements ScmLogger 028{ 029 030 private boolean debug = false; 031 032 public DefaultLog() 033 { 034 // no op 035 } 036 037 public DefaultLog( boolean debug ) 038 { 039 this.debug = debug; 040 } 041 042 /** 043 * {@inheritDoc} 044 */ 045 public boolean isDebugEnabled() 046 { 047 return this.debug; 048 } 049 050 /** 051 * {@inheritDoc} 052 */ 053 public void debug( String content ) 054 { 055 if ( this.debug ) 056 { 057 System.out.println( content ); 058 } 059 } 060 061 /** 062 * {@inheritDoc} 063 */ 064 public void debug( String content, Throwable error ) 065 { 066 if ( this.debug ) 067 { 068 System.out.println( content ); 069 error.printStackTrace(); 070 } 071 } 072 073 /** 074 * {@inheritDoc} 075 */ 076 public void debug( Throwable error ) 077 { 078 if ( this.debug ) 079 { 080 error.printStackTrace(); 081 } 082 } 083 084 /** 085 * {@inheritDoc} 086 */ 087 public boolean isInfoEnabled() 088 { 089 return true; 090 } 091 092 /** 093 * {@inheritDoc} 094 */ 095 public void info( String content ) 096 { 097 System.out.println( content ); 098 } 099 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}