Search in sources :

Example 1 with AntLogHandler

use of net.sourceforge.pmd.util.log.AntLogHandler in project pmd by pmd.

the class PMDTaskImpl method execute.

public void execute() throws BuildException {
    final Handler antLogHandler = new AntLogHandler(project);
    final ScopedLogHandlersManager logManager = new ScopedLogHandlersManager(Level.FINEST, antLogHandler);
    try {
        doTask();
    } finally {
        logManager.close();
        // exceptions
        if (configuration.getClassLoader() instanceof ClasspathClassLoader) {
            IOUtil.tryCloseClassLoader(configuration.getClassLoader());
        }
    }
}
Also used : ClasspathClassLoader(net.sourceforge.pmd.util.ClasspathClassLoader) AntLogHandler(net.sourceforge.pmd.util.log.AntLogHandler) Handler(java.util.logging.Handler) AntLogHandler(net.sourceforge.pmd.util.log.AntLogHandler) ScopedLogHandlersManager(net.sourceforge.pmd.util.log.ScopedLogHandlersManager)

Aggregations

Handler (java.util.logging.Handler)1 ClasspathClassLoader (net.sourceforge.pmd.util.ClasspathClassLoader)1 AntLogHandler (net.sourceforge.pmd.util.log.AntLogHandler)1 ScopedLogHandlersManager (net.sourceforge.pmd.util.log.ScopedLogHandlersManager)1