Search in sources :

Example 6 with DefaultLogger

use of com.puppycrawl.tools.checkstyle.DefaultLogger in project maven-plugins by apache.

the class CheckstyleViolationCheckMojo method getConsoleListener.

private DefaultLogger getConsoleListener() throws MojoExecutionException {
    DefaultLogger consoleListener;
    if (useFile == null) {
        stringOutputStream = new ByteArrayOutputStream();
        consoleListener = new DefaultLogger(stringOutputStream, false);
    } else {
        OutputStream out = getOutputStream(useFile);
        consoleListener = new DefaultLogger(out, true);
    }
    return consoleListener;
}
Also used : ByteArrayOutputStream(java.io.ByteArrayOutputStream) OutputStream(java.io.OutputStream) FileOutputStream(java.io.FileOutputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) DefaultLogger(com.puppycrawl.tools.checkstyle.DefaultLogger)

Aggregations

DefaultLogger (com.puppycrawl.tools.checkstyle.DefaultLogger)6 FileOutputStream (java.io.FileOutputStream)5 OutputStream (java.io.OutputStream)5 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 AuditListener (com.puppycrawl.tools.checkstyle.api.AuditListener)3 File (java.io.File)3 XMLLogger (com.puppycrawl.tools.checkstyle.XMLLogger)2 IOException (java.io.IOException)2 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 MojoFailureException (org.apache.maven.plugin.MojoFailureException)1 MavenReportException (org.apache.maven.reporting.MavenReportException)1 BuildException (org.apache.tools.ant.BuildException)1 LogOutputStream (org.apache.tools.ant.taskdefs.LogOutputStream)1 Test (org.junit.Test)1