1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugin.surefire.log;
20
21 import org.apache.maven.plugin.surefire.log.api.ConsoleLogger;
22 import org.codehaus.plexus.logging.Logger;
23
24
25
26
27
28
29
30
31
32
33
34
35 public final class PluginConsoleLogger implements ConsoleLogger {
36 private final Logger plexusLogger;
37
38 public PluginConsoleLogger(Logger plexusLogger) {
39 this.plexusLogger = plexusLogger;
40 }
41
42 @Override
43 public boolean isDebugEnabled() {
44 return plexusLogger.isDebugEnabled();
45 }
46
47 @Override
48 public synchronized void debug(String message) {
49 plexusLogger.debug(message);
50 }
51
52 public synchronized void debug(CharSequence content, Throwable error) {
53 plexusLogger.debug(content == null ? "" : content.toString(), error);
54 }
55
56 @Override
57 public boolean isInfoEnabled() {
58 return plexusLogger.isInfoEnabled();
59 }
60
61 @Override
62 public synchronized void info(String message) {
63 plexusLogger.info(message);
64 }
65
66 @Override
67 public boolean isWarnEnabled() {
68 return plexusLogger.isWarnEnabled();
69 }
70
71 @Override
72 public synchronized void warning(String message) {
73 plexusLogger.warn(message);
74 }
75
76 public synchronized void warning(CharSequence content, Throwable error) {
77 plexusLogger.warn(content == null ? "" : content.toString(), error);
78 }
79
80 @Override
81 public boolean isErrorEnabled() {
82 return plexusLogger.isErrorEnabled() || plexusLogger.isFatalErrorEnabled();
83 }
84
85 @Override
86 public synchronized void error(String message) {
87 plexusLogger.error(message);
88 }
89
90 @Override
91 public synchronized void error(String message, Throwable t) {
92 plexusLogger.error(message, t);
93 }
94
95 @Override
96 public synchronized void error(Throwable t) {
97 plexusLogger.error("", t);
98 }
99 }