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