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 import java.util.ArrayList;
23 import java.util.List;
24
25
26
27
28
29 public class ScmLogDispatcher
30 implements ScmLogger
31 {
32 private List<ScmLogger> listeners = new ArrayList<ScmLogger>();
33
34 public void addListener( ScmLogger logger )
35 {
36 listeners.add( logger );
37 }
38
39
40 public void debug( String content, Throwable error )
41 {
42 for ( ScmLogger logger : listeners )
43 {
44 logger.debug( content, error );
45 }
46 }
47
48
49 public void debug( String content )
50 {
51 for ( ScmLogger logger : listeners )
52 {
53 logger.debug( content );
54 }
55 }
56
57
58 public void debug( Throwable error )
59 {
60 for ( ScmLogger logger : listeners )
61 {
62 logger.debug( error );
63 }
64 }
65
66
67 public void error( String content, Throwable error )
68 {
69 for ( ScmLogger logger : listeners )
70 {
71 logger.error( content, error );
72 }
73 }
74
75
76 public void error( String content )
77 {
78 for ( ScmLogger logger : listeners )
79 {
80 logger.error( content );
81 }
82 }
83
84
85 public void error( Throwable error )
86 {
87 for ( ScmLogger logger : listeners )
88 {
89 logger.error( error );
90 }
91 }
92
93
94 public void info( String content, Throwable error )
95 {
96 for ( ScmLogger logger : listeners )
97 {
98 if ( logger.isInfoEnabled() )
99 {
100 logger.info( content, error );
101 }
102 }
103 }
104
105
106 public void info( String content )
107 {
108 for ( ScmLogger logger : listeners )
109 {
110 if ( logger.isInfoEnabled() )
111 {
112 logger.info( content );
113 }
114 }
115 }
116
117
118 public void info( Throwable error )
119 {
120 for ( ScmLogger logger : listeners )
121 {
122 if ( logger.isInfoEnabled() )
123 {
124 logger.info( error );
125 }
126 }
127 }
128
129
130 public boolean isDebugEnabled()
131 {
132 for ( ScmLogger logger : listeners )
133 {
134 if ( logger.isDebugEnabled() )
135 {
136 return true;
137 }
138 }
139
140 return false;
141 }
142
143
144 public boolean isErrorEnabled()
145 {
146 for ( ScmLogger logger : listeners )
147 {
148 if ( logger.isErrorEnabled() )
149 {
150 return true;
151 }
152 }
153
154 return false;
155 }
156
157
158 public boolean isInfoEnabled()
159 {
160 for ( ScmLogger logger : listeners )
161 {
162 if ( logger.isInfoEnabled() )
163 {
164 return true;
165 }
166 }
167
168 return false;
169 }
170
171
172 public boolean isWarnEnabled()
173 {
174 for ( ScmLogger logger : listeners )
175 {
176 if ( logger.isWarnEnabled() )
177 {
178 return true;
179 }
180 }
181
182 return false;
183 }
184
185
186 public void warn( String content, Throwable error )
187 {
188 for ( ScmLogger logger : listeners )
189 {
190 logger.warn( content, error );
191 }
192 }
193
194
195 public void warn( String content )
196 {
197 for ( ScmLogger logger : listeners )
198 {
199 logger.warn( content );
200 }
201 }
202
203
204 public void warn( Throwable error )
205 {
206 for ( ScmLogger logger : listeners )
207 {
208 logger.warn( error );
209 }
210 }
211 }