-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore AbstractCompiler#getLogger() method
We need preserve a compatibility for some time.
- Loading branch information
1 parent
49a464d
commit 3ab39cd
Showing
5 changed files
with
156 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,10 @@ | |
* @author <a href="mailto:[email protected]">Trygve Laugstøl</a> | ||
*/ | ||
public abstract class AbstractCompiler implements Compiler { | ||
protected Logger log = LoggerFactory.getLogger(getClass()); | ||
private final Logger log = LoggerFactory.getLogger(getClass()); | ||
|
||
private final org.codehaus.plexus.logging.Logger plexusLogger; | ||
|
||
protected static final String EOL = System.lineSeparator(); | ||
|
||
protected static final String PS = System.getProperty("path.separator"); | ||
|
@@ -68,6 +71,25 @@ protected AbstractCompiler( | |
this.outputFileEnding = outputFileEnding; | ||
|
||
this.outputFile = outputFile; | ||
|
||
this.plexusLogger = new PlexusLoggerWrapper(log); | ||
} | ||
|
||
/** | ||
* | ||
* @return a Logger | ||
*/ | ||
protected Logger getLog() { | ||
return log; | ||
} | ||
|
||
/** | ||
* @return a plexus Logger | ||
* @deprecated please use {@link #getLog()} | ||
*/ | ||
@Deprecated | ||
protected org.codehaus.plexus.logging.Logger getLogger() { | ||
return plexusLogger; | ||
} | ||
|
||
// ---------------------------------------------------------------------- | ||
|
107 changes: 107 additions & 0 deletions
107
plexus-compiler-api/src/main/java/org/codehaus/plexus/compiler/PlexusLoggerWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
package org.codehaus.plexus.compiler; | ||
|
||
import org.slf4j.Logger; | ||
|
||
class PlexusLoggerWrapper implements org.codehaus.plexus.logging.Logger { | ||
|
||
private final Logger log; | ||
|
||
PlexusLoggerWrapper(Logger log) { | ||
this.log = log; | ||
} | ||
|
||
@Override | ||
public void debug(String message) { | ||
log.debug(message); | ||
} | ||
|
||
@Override | ||
public void debug(String message, Throwable throwable) { | ||
log.debug(message, throwable); | ||
} | ||
|
||
@Override | ||
public boolean isDebugEnabled() { | ||
return log.isDebugEnabled(); | ||
} | ||
|
||
@Override | ||
public void info(String message) { | ||
log.info(message); | ||
} | ||
|
||
@Override | ||
public void info(String message, Throwable throwable) { | ||
log.info(message, throwable); | ||
} | ||
|
||
@Override | ||
public boolean isInfoEnabled() { | ||
return log.isInfoEnabled(); | ||
} | ||
|
||
@Override | ||
public void warn(String message) { | ||
log.warn(message); | ||
} | ||
|
||
@Override | ||
public void warn(String message, Throwable throwable) { | ||
log.warn(message, throwable); | ||
} | ||
|
||
@Override | ||
public boolean isWarnEnabled() { | ||
return log.isWarnEnabled(); | ||
} | ||
|
||
@Override | ||
public void error(String message) { | ||
log.error(message); | ||
} | ||
|
||
@Override | ||
public void error(String message, Throwable throwable) { | ||
log.error(message, throwable); | ||
} | ||
|
||
@Override | ||
public boolean isErrorEnabled() { | ||
return log.isErrorEnabled(); | ||
} | ||
|
||
@Override | ||
public void fatalError(String message) { | ||
log.error(message); | ||
} | ||
|
||
@Override | ||
public void fatalError(String message, Throwable throwable) { | ||
log.error(message, throwable); | ||
} | ||
|
||
@Override | ||
public boolean isFatalErrorEnabled() { | ||
return log.isErrorEnabled(); | ||
} | ||
|
||
@Override | ||
public int getThreshold() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void setThreshold(int threshold) { | ||
// not implemented | ||
} | ||
|
||
@Override | ||
public org.codehaus.plexus.logging.Logger getChildLogger(String name) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return log.getName(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters