Search in sources :

Example 11 with OperationIdentifier

use of org.gradle.internal.operations.OperationIdentifier in project gradle by gradle.

the class OutputEventListenerBackedLogger method log.

private void log(LogLevel logLevel, Throwable throwable, String message) {
    OperationIdentifier buildOperationId = CurrentBuildOperationRef.instance().getId();
    LogEvent logEvent = new LogEvent(clock.getCurrentTime(), name, logLevel, message, throwable, buildOperationId);
    OutputEventListener outputEventListener = context.getOutputEventListener();
    try {
        outputEventListener.onOutput(logEvent);
    } catch (Throwable e) {
        // fall back to standard out
        e.printStackTrace(System.out);
    }
}
Also used : LogEvent(org.gradle.internal.logging.events.LogEvent) OperationIdentifier(org.gradle.internal.operations.OperationIdentifier) OutputEventListener(org.gradle.internal.logging.events.OutputEventListener)

Aggregations

OperationIdentifier (org.gradle.internal.operations.OperationIdentifier)11 LogLevel (org.gradle.api.logging.LogLevel)2 LogEvent (org.gradle.internal.logging.events.LogEvent)2 ProgressCompleteEvent (org.gradle.internal.logging.events.ProgressCompleteEvent)2 ProgressEvent (org.gradle.internal.logging.events.ProgressEvent)2 ProgressStartEvent (org.gradle.internal.logging.events.ProgressStartEvent)2 StyledTextOutputEvent (org.gradle.internal.logging.events.StyledTextOutputEvent)2 BuildOperationCategory (org.gradle.internal.operations.BuildOperationCategory)2 HashSet (java.util.HashSet)1 Task (org.gradle.api.Task)1 ExecuteTaskBuildOperationDetails (org.gradle.api.execution.internal.ExecuteTaskBuildOperationDetails)1 EndOutputEvent (org.gradle.internal.logging.events.EndOutputEvent)1 OutputEvent (org.gradle.internal.logging.events.OutputEvent)1 OutputEventListener (org.gradle.internal.logging.events.OutputEventListener)1 DefaultTaskStartedProgressEvent (org.gradle.tooling.internal.provider.events.DefaultTaskStartedProgressEvent)1