com.atlassian.maven.plugin.clover.MvnLogger Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of maven-clover2-plugin Show documentation
Show all versions of maven-clover2-plugin Show documentation
Maven plugin for Clover.
MIGRATION NOTICE: Since next major Clover release this plugin will be renamed to
com.atlassian.maven.plugins:clover-maven-plugin. Thus, goals will also be renamed, e.g.
'clover2:setup' will become 'clover:setup'.
The newest version!
package com.atlassian.maven.plugin.clover;
import com.atlassian.clover.Logger;
import org.apache.maven.plugin.logging.Log;
/**
*/
public class MvnLogger extends Logger {
private final Log log;
public MvnLogger(Log mvnLog) {
log = mvnLog;
}
public void log(int level, String msg, Throwable t) {
switch (level) {
case Logger.LOG_DEBUG:
case Logger.LOG_VERBOSE: log.debug(msg, t); break;
case Logger.LOG_INFO: log.info(msg, t); break;
case Logger.LOG_WARN: log.warn(msg, t); break;
default: log.info(msg, t);
}
}
public static class MvnLoggerFactory implements Logger.Factory {
private final Logger logger;
public MvnLoggerFactory(Log log) {
logger = new MvnLogger(log);
}
public Logger getLoggerInstance(String category) {
return logger;
}
}
}