org.gradle.api.logging
Class StandardOutputLogging

java.lang.Object
  extended by org.gradle.api.logging.StandardOutputLogging

public class StandardOutputLogging
extends java.lang.Object


Nested Class Summary
static class StandardOutputLogging.LoggingPrintStream
           
 
Field Summary
static java.io.PrintStream DEFAULT_ERR
           
static java.io.PrintStream DEFAULT_OUT
           
static java.lang.ThreadLocal<StandardOutputLogging.LoggingPrintStream> ERR_LOGGING_STREAM
           
static java.lang.ThreadLocal<StandardOutputLogging.LoggingPrintStream> OUT_LOGGING_STREAM
           
 
Constructor Summary
StandardOutputLogging()
           
 
Method Summary
static void flush()
           
static StandardOutputState getStateSnapshot()
          Returns the current values for System.out and Sytem.err.
static void off()
          Sets System.err and System.out to the values they had before Gradle has been started.
static void offErr()
          Sets System.err to the values it had before Gradle has been started.
static void offOut()
          Sets System.out to the values it had before Gradle has been started.
static void on(LogLevel outLogLevel)
          Redirects the standard out to the Gradle logging.
static void onErr(LogLevel errLogLevel)
          Redirects only System.err to the specified level.
static void onOut(LogLevel outLogLevel)
          Redirects only System.out to the specified level.
static void restoreState(StandardOutputState state)
          Sets the values for System.out and Sytem.err.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OUT_LOGGING_STREAM

public static final java.lang.ThreadLocal<StandardOutputLogging.LoggingPrintStream> OUT_LOGGING_STREAM

ERR_LOGGING_STREAM

public static final java.lang.ThreadLocal<StandardOutputLogging.LoggingPrintStream> ERR_LOGGING_STREAM

DEFAULT_OUT

public static final java.io.PrintStream DEFAULT_OUT

DEFAULT_ERR

public static final java.io.PrintStream DEFAULT_ERR
Constructor Detail

StandardOutputLogging

public StandardOutputLogging()
Method Detail

on

public static void on(LogLevel outLogLevel)
Redirects the standard out to the Gradle logging. The System.out is redirected to specified level. System.err is always redirected to the ERROR level.

Parameters:
outLogLevel - Log level for System.out

onOut

public static void onOut(LogLevel outLogLevel)
Redirects only System.out to the specified level. System.err is not redirected.

Parameters:
outLogLevel - Log level for System.out

onErr

public static void onErr(LogLevel errLogLevel)
Redirects only System.err to the specified level. System.out is not redirected.

Parameters:
errLogLevel - Log level for System.err

flush

public static void flush()

off

public static void off()
Sets System.err and System.out to the values they had before Gradle has been started.


offOut

public static void offOut()
Sets System.out to the values it had before Gradle has been started.


offErr

public static void offErr()
Sets System.err to the values it had before Gradle has been started.


getStateSnapshot

public static StandardOutputState getStateSnapshot()
Returns the current values for System.out and Sytem.err.


restoreState

public static void restoreState(StandardOutputState state)
Sets the values for System.out and Sytem.err.