Search in sources :

Example 1 with OutputEventListener

use of org.gradle.internal.logging.events.OutputEventListener in project gradle by gradle.

the class OutputEventRenderer method addRichConsole.

public void addRichConsole(Console stdout, Console stderr, ConsoleMetaData consoleMetaData, boolean verbose) {
    OutputEventListener stdoutChain = new StyledTextOutputBackedRenderer(stdout.getBuildOutputArea());
    OutputEventListener stderrChain = new FlushConsoleListener(stderr, new StyledTextOutputBackedRenderer(stderr.getBuildOutputArea()));
    OutputEventListener consoleListener = new ErrorOutputDispatchingListener(stderrChain, stdoutChain);
    OutputEventListener consoleChain = getConsoleChainWithDynamicStdout(stdout, consoleMetaData, verbose, consoleListener);
    addConsoleChain(consoleChain);
}
Also used : StyledTextOutputBackedRenderer(org.gradle.internal.logging.console.StyledTextOutputBackedRenderer) OutputEventListener(org.gradle.internal.logging.events.OutputEventListener) ThrottlingOutputEventListener(org.gradle.internal.logging.console.ThrottlingOutputEventListener) FlushConsoleListener(org.gradle.internal.logging.console.FlushConsoleListener)

Example 2 with OutputEventListener

use of org.gradle.internal.logging.events.OutputEventListener in project gradle by gradle.

the class OutputEventRenderer method addPlainConsole.

public void addPlainConsole(OutputStream stdout, OutputStream stderr) {
    OutputEventListener stdoutChain = new StyledTextOutputBackedRenderer(new StreamingStyledTextOutput(new StreamBackedStandardOutputListener(stdout)));
    OutputEventListener stderrChain = new StyledTextOutputBackedRenderer(new StreamingStyledTextOutput(new StreamBackedStandardOutputListener(stderr)));
    OutputEventListener outputListener = new ErrorOutputDispatchingListener(stderrChain, stdoutChain);
    addConsoleChain(getConsoleChainWithoutDynamicStdout(outputListener, true));
}
Also used : StyledTextOutputBackedRenderer(org.gradle.internal.logging.console.StyledTextOutputBackedRenderer) StreamingStyledTextOutput(org.gradle.internal.logging.text.StreamingStyledTextOutput) OutputEventListener(org.gradle.internal.logging.events.OutputEventListener) ThrottlingOutputEventListener(org.gradle.internal.logging.console.ThrottlingOutputEventListener) StreamBackedStandardOutputListener(org.gradle.internal.logging.text.StreamBackedStandardOutputListener)

Example 3 with OutputEventListener

use of org.gradle.internal.logging.events.OutputEventListener in project gradle by gradle.

the class DefaultLoggingManager method stop.

@Override
public DefaultLoggingManager stop() {
    try {
        CompositeStoppable.stoppable(slf4jLoggingSystem, javaUtilLoggingSystem, stdOutLoggingSystem, stdErrLoggingSystem).stop();
        for (StandardOutputListener stdoutListener : stdoutListeners) {
            loggingOutput.removeStandardOutputListener(stdoutListener);
        }
        for (StandardOutputListener stderrListener : stderrListeners) {
            loggingOutput.removeStandardErrorListener(stderrListener);
        }
        for (OutputEventListener listener : outputEventListeners) {
            loggingOutput.removeOutputEventListener(listener);
        }
        loggingRouter.stop();
    } finally {
        started = false;
    }
    return this;
}
Also used : StreamBackedStandardOutputListener(org.gradle.internal.logging.text.StreamBackedStandardOutputListener) StandardOutputListener(org.gradle.api.logging.StandardOutputListener) OutputEventListener(org.gradle.internal.logging.events.OutputEventListener)

Example 4 with OutputEventListener

use of org.gradle.internal.logging.events.OutputEventListener in project gradle by gradle.

the class OutputEventRenderer method addConsole.

public OutputEventRenderer addConsole(Console console, boolean stdout, boolean stderr, ConsoleMetaData consoleMetaData) {
    final OutputEventListener consoleChain = new ThrottlingOutputEventListener(new BuildStatusRenderer(new WorkInProgressRenderer(new ProgressLogEventGenerator(new StyledTextOutputBackedRenderer(console.getBuildOutputArea()), true), console.getBuildProgressArea(), new DefaultWorkInProgressFormatter(consoleMetaData)), console.getStatusBar(), console, consoleMetaData), new TrueTimeProvider());
    synchronized (lock) {
        if (stdout && stderr) {
            this.console = consoleChain;
            removeStandardOutputListener();
            removeStandardErrorListener();
        } else if (stdout) {
            this.console = onNonError(consoleChain);
            removeStandardOutputListener();
        } else {
            this.console = onError(consoleChain);
            removeStandardErrorListener();
        }
        consoleChain.onOutput(new LogLevelChangeEvent(logLevel));
        formatters.add(this.console);
    }
    return this;
}
Also used : LogLevelChangeEvent(org.gradle.internal.logging.events.LogLevelChangeEvent) BuildStatusRenderer(org.gradle.internal.logging.console.BuildStatusRenderer) ThrottlingOutputEventListener(org.gradle.internal.logging.console.ThrottlingOutputEventListener) StyledTextOutputBackedRenderer(org.gradle.internal.logging.console.StyledTextOutputBackedRenderer) TrueTimeProvider(org.gradle.internal.time.TrueTimeProvider) WorkInProgressRenderer(org.gradle.internal.logging.console.WorkInProgressRenderer) OutputEventListener(org.gradle.internal.logging.events.OutputEventListener) BatchOutputEventListener(org.gradle.internal.logging.events.BatchOutputEventListener) ThrottlingOutputEventListener(org.gradle.internal.logging.console.ThrottlingOutputEventListener) DefaultWorkInProgressFormatter(org.gradle.internal.logging.console.DefaultWorkInProgressFormatter)

Example 5 with OutputEventListener

use of org.gradle.internal.logging.events.OutputEventListener in project gradle by gradle.

the class OutputEventRenderer method addPlainConsole.

private OutputEventRenderer addPlainConsole(StandardOutputListener outputListener) {
    OutputEventListener stdoutChain = new UserInputStandardOutputRenderer(new StyledTextOutputBackedRenderer(new StreamingStyledTextOutput(outputListener)), clock);
    OutputEventListener consoleChain = new ThrottlingOutputEventListener(new BuildLogLevelFilterRenderer(new GroupingProgressLogEventGenerator(stdoutChain, clock, new PrettyPrefixedLogHeaderFormatter(), true)), clock);
    return addConsoleChain(consoleChain, true, true);
}
Also used : StyledTextOutputBackedRenderer(org.gradle.internal.logging.console.StyledTextOutputBackedRenderer) ThrottlingOutputEventListener(org.gradle.internal.logging.console.ThrottlingOutputEventListener) StreamingStyledTextOutput(org.gradle.internal.logging.text.StreamingStyledTextOutput) OutputEventListener(org.gradle.internal.logging.events.OutputEventListener) ThrottlingOutputEventListener(org.gradle.internal.logging.console.ThrottlingOutputEventListener) UserInputStandardOutputRenderer(org.gradle.internal.logging.console.UserInputStandardOutputRenderer) BuildLogLevelFilterRenderer(org.gradle.internal.logging.console.BuildLogLevelFilterRenderer) PrettyPrefixedLogHeaderFormatter(org.gradle.internal.logging.format.PrettyPrefixedLogHeaderFormatter)

Aggregations

OutputEventListener (org.gradle.internal.logging.events.OutputEventListener)14 StyledTextOutputBackedRenderer (org.gradle.internal.logging.console.StyledTextOutputBackedRenderer)9 ThrottlingOutputEventListener (org.gradle.internal.logging.console.ThrottlingOutputEventListener)9 StreamBackedStandardOutputListener (org.gradle.internal.logging.text.StreamBackedStandardOutputListener)7 StreamingStyledTextOutput (org.gradle.internal.logging.text.StreamingStyledTextOutput)6 StandardOutputListener (org.gradle.api.logging.StandardOutputListener)3 BuildLogLevelFilterRenderer (org.gradle.internal.logging.console.BuildLogLevelFilterRenderer)2 FlushConsoleListener (org.gradle.internal.logging.console.FlushConsoleListener)2 LogEvent (org.gradle.internal.logging.events.LogEvent)2 LogLevelChangeEvent (org.gradle.internal.logging.events.LogLevelChangeEvent)2 LoggingSourceSystem (org.gradle.internal.logging.config.LoggingSourceSystem)1 LoggingSystemAdapter (org.gradle.internal.logging.config.LoggingSystemAdapter)1 BuildStatusRenderer (org.gradle.internal.logging.console.BuildStatusRenderer)1 DefaultWorkInProgressFormatter (org.gradle.internal.logging.console.DefaultWorkInProgressFormatter)1 UserInputStandardOutputRenderer (org.gradle.internal.logging.console.UserInputStandardOutputRenderer)1 WorkInProgressRenderer (org.gradle.internal.logging.console.WorkInProgressRenderer)1 BatchOutputEventListener (org.gradle.internal.logging.events.BatchOutputEventListener)1 EndOutputEvent (org.gradle.internal.logging.events.EndOutputEvent)1 FlushOutputEvent (org.gradle.internal.logging.events.FlushOutputEvent)1 OutputEvent (org.gradle.internal.logging.events.OutputEvent)1