public class Console extends Object
Constructor and Description |
---|
Console(Verbosity verbosity,
PrintStream stdOut,
PrintStream stdErr,
Ansi ansi) |
Modifier and Type | Method and Description |
---|---|
static Console |
createNullConsole()
Returns a
Console that simply discards written bytes. |
Ansi |
getAnsi() |
DirtyPrintStreamDecorator |
getStdErr() |
DirtyPrintStreamDecorator |
getStdOut() |
Verbosity |
getVerbosity() |
void |
printBuildFailure(String failureMessage)
Prints an error message prefixed with
BUILD FAILED to stderr that will be highlighted
in red if stderr is a tty. |
void |
printErrorText(String message)
Prints an error message to stderr that will be highlighted in red if stderr is a tty.
|
void |
printErrorText(String message,
Object... args)
Prints a formatted error message.
|
void |
printFailure(String failureMessage)
Prints error message to console in red, also logs stacktrace but does not display it
|
void |
printSuccess(String successMessage) |
void |
printSuccess(String successMessage,
Object... args)
Prints a formatted success message.
|
public Console(Verbosity verbosity, PrintStream stdOut, PrintStream stdErr, Ansi ansi)
public static Console createNullConsole()
Console
that simply discards written bytes.public Verbosity getVerbosity()
public Ansi getAnsi()
public DirtyPrintStreamDecorator getStdOut()
public DirtyPrintStreamDecorator getStdErr()
public void printSuccess(String successMessage)
successMessage
- single line of text without a trailing newline. If stdErr is attached to
a terminal, then this will append an ANSI reset escape sequence followed by a newline.public void printSuccess(String successMessage, Object... args)
printSuccess(String)
public void printErrorText(String message)
public void printErrorText(String message, Object... args)
printErrorText(String)
public void printBuildFailure(String failureMessage)
BUILD FAILED
to stderr that will be highlighted
in red if stderr is a tty.public void printFailure(String failureMessage)