All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.atlassian.maven.plugin.clover.MvnLogger Maven / Gradle / Ivy

Go to download

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;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy