public final class StaticLoggerBinder extends Object implements LoggerFactoryBinder
ILoggerFactory class with
an actual instance of ILoggerFactory is
performed using information returned by this class.
This is what you should do in your Maven plugin (before everything else):
import org.apache.maven.plugin.AbstractMojo;
import org.slf4j.impl.StaticLoggerBinder;
public class MyMojo extends AbstractMojo {
@Override
public void execute() {
StaticLoggerBinder.getSingleton().setMavenLog(this.getLog());
// ... all the rest
}
}
All SLF4J calls will be forwarded to Maven Log.
The class is thread-safe.
| Modifier and Type | Field and Description |
|---|---|
static String |
REQUESTED_API_VERSION
Declare the version of the SLF4J API this implementation is compiled
against.
|
| Modifier and Type | Method and Description |
|---|---|
ILoggerFactory |
getLoggerFactory() |
String |
getLoggerFactoryClassStr() |
static StaticLoggerBinder |
getSingleton()
Return the singleton of this class.
|
void |
setMavenLog(Log log)
Set Maven Log.
|
public static final String REQUESTED_API_VERSION
public static StaticLoggerBinder getSingleton()
public void setMavenLog(Log log)
log - The log from Maven pluginpublic ILoggerFactory getLoggerFactory()
getLoggerFactory in interface LoggerFactoryBinderpublic String getLoggerFactoryClassStr()
getLoggerFactoryClassStr in interface LoggerFactoryBinderCopyright © 2012–2013 jcabi.com. All rights reserved.