1 | |
package org.apache.maven.monitor.logging; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
import org.apache.maven.plugin.logging.Log; |
23 | |
import org.codehaus.plexus.logging.Logger; |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
public class DefaultLog |
29 | |
implements Log |
30 | |
{ |
31 | |
|
32 | |
private final Logger logger; |
33 | |
|
34 | |
public DefaultLog( Logger logger ) |
35 | 0 | { |
36 | 0 | this.logger = logger; |
37 | 0 | } |
38 | |
|
39 | |
public void debug( CharSequence content ) |
40 | |
{ |
41 | 0 | logger.debug( toString( content ) ); |
42 | 0 | } |
43 | |
|
44 | |
private String toString( CharSequence content ) |
45 | |
{ |
46 | 0 | if ( content == null ) |
47 | |
{ |
48 | 0 | return ""; |
49 | |
} |
50 | |
else |
51 | |
{ |
52 | 0 | return content.toString(); |
53 | |
} |
54 | |
} |
55 | |
|
56 | |
public void debug( CharSequence content, Throwable error ) |
57 | |
{ |
58 | 0 | logger.debug( toString( content ), error ); |
59 | 0 | } |
60 | |
|
61 | |
public void debug( Throwable error ) |
62 | |
{ |
63 | 0 | logger.debug( "", error ); |
64 | 0 | } |
65 | |
|
66 | |
public void info( CharSequence content ) |
67 | |
{ |
68 | 0 | logger.info( toString( content ) ); |
69 | 0 | } |
70 | |
|
71 | |
public void info( CharSequence content, Throwable error ) |
72 | |
{ |
73 | 0 | logger.info( toString( content ), error ); |
74 | 0 | } |
75 | |
|
76 | |
public void info( Throwable error ) |
77 | |
{ |
78 | 0 | logger.info( "", error ); |
79 | 0 | } |
80 | |
|
81 | |
public void warn( CharSequence content ) |
82 | |
{ |
83 | 0 | logger.warn( toString( content ) ); |
84 | 0 | } |
85 | |
|
86 | |
public void warn( CharSequence content, Throwable error ) |
87 | |
{ |
88 | 0 | logger.warn( toString( content ), error ); |
89 | 0 | } |
90 | |
|
91 | |
public void warn( Throwable error ) |
92 | |
{ |
93 | 0 | logger.warn( "", error ); |
94 | 0 | } |
95 | |
|
96 | |
public void error( CharSequence content ) |
97 | |
{ |
98 | 0 | logger.error( toString( content ) ); |
99 | 0 | } |
100 | |
|
101 | |
public void error( CharSequence content, Throwable error ) |
102 | |
{ |
103 | 0 | logger.error( toString( content ), error ); |
104 | 0 | } |
105 | |
|
106 | |
public void error( Throwable error ) |
107 | |
{ |
108 | 0 | logger.error( "", error ); |
109 | 0 | } |
110 | |
|
111 | |
public boolean isDebugEnabled() |
112 | |
{ |
113 | 0 | return logger.isDebugEnabled(); |
114 | |
} |
115 | |
|
116 | |
public boolean isInfoEnabled() |
117 | |
{ |
118 | 0 | return logger.isInfoEnabled(); |
119 | |
} |
120 | |
|
121 | |
public boolean isWarnEnabled() |
122 | |
{ |
123 | 0 | return logger.isWarnEnabled(); |
124 | |
} |
125 | |
|
126 | |
public boolean isErrorEnabled() |
127 | |
{ |
128 | 0 | return logger.isErrorEnabled(); |
129 | |
} |
130 | |
|
131 | |
} |