Groovy Documentation

org.gradle.api.logging
Class StandardOutputLogging

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

class StandardOutputLogging
extends java.lang.Object

author:
Hans Dockter


Nested Class Summary
class StandardOutputLogging.LoggingPrintStream

 
Field Summary
static PrintStream DEFAULT_ERR

static PrintStream DEFAULT_OUT

static java.lang.ThreadLocal ERR_LOGGING_STREAM

static java.lang.ThreadLocal OUT_LOGGING_STREAM

 
Constructor Summary
StandardOutputLogging()

 
Method Summary
static void flush()

static StandardOutputLoggingAdapter getErrAdapter()

static StandardOutputLoggingAdapter getOutAdapter()

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 printToDefaultOut(java.lang.String msg)

Prints to default out (The System.out stream before Gradle was started), independent of the redirections of System.out.

static void restoreState(StandardOutputState state)

Sets the values for System.out and Sytem.err.

 
Methods inherited from class java.lang.Object
hashCode, getClass, equals, toString, wait, wait, wait, notify, notifyAll
 

Field Detail

DEFAULT_ERR

static final PrintStream DEFAULT_ERR


DEFAULT_OUT

static final PrintStream DEFAULT_OUT


ERR_LOGGING_STREAM

static final java.lang.ThreadLocal ERR_LOGGING_STREAM


OUT_LOGGING_STREAM

static final java.lang.ThreadLocal OUT_LOGGING_STREAM


 
Constructor Detail

StandardOutputLogging

StandardOutputLogging()


 
Method Detail

flush

public static void flush()


getErrAdapter

public static StandardOutputLoggingAdapter getErrAdapter()


getOutAdapter

public static StandardOutputLoggingAdapter getOutAdapter()


getStateSnapshot

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


off

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


offErr

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


offOut

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


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.
param:
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.
param:
errLogLevel Log level for System.err


onOut

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


printToDefaultOut

public static void printToDefaultOut(java.lang.String msg)
Prints to default out (The System.out stream before Gradle was started), independent of the redirections of System.out. The message is printed via a print not a println.
param:
msg The message to print


restoreState

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


 

Groovy Documentation