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

com.atlassian.clover.DefaultLogger Maven / Gradle / Ivy

Go to download

Clover is an award winning code coverage and testing tool for Java and Groovy. It integrates easily with Maven, Ant, Grails, Eclipse and IntelliJ IDEA as well as with continuous integration servers such as Bamboo, Jenkins or Hudson. Note: before Clover 4.0 this artifact was named com.cenqua.clover:clover.

The newest version!
package com.atlassian.clover;

import java.io.PrintStream;

public class DefaultLogger extends Logger {
    private static final String[] LOG_LEVEL_STR = {
        "ERROR",
        "WARN",
        "INFO",
        "VERBOSE",
        "DEBUG"
    };

    @Override
    public void log(int level, String msg, Throwable t) {
        if (canIgnore(level)) {
            return;
        }

        final PrintStream stream;
        final String decoratedMsg;
        if (level >= LOG_INFO ) {
            // for INFO or below level msgs, print the msg only, nothing else
            decoratedMsg = msg;
            stream = System.out;
        } else {
            // since we are obfuscating, mName shouldn't be printed.
            decoratedMsg = LOG_LEVEL_STR[level] + ": " + msg;
            stream = System.err;            
        }
        stream.print(decoratedMsg);

        if (t != null && (isVerbose() || isDebug())) {
            System.err.println(msg + " : " + t.getMessage());
            t.printStackTrace();
        } else {
            stream.println();
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy