public class DuplicatingConsole extends Console
Example use case is to duplicate a console that writes to system stdout/stderr to a Log file.
Constructor and Description |
---|
DuplicatingConsole(Console main) |
Modifier and Type | Method and Description |
---|---|
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.
|
void |
setDuplicatingConsole(Optional<Console> duplicateConsole) |
createNullConsole, getAnsi, getStdErr, getStdOut, getVerbosity
public DuplicatingConsole(Console main)
public void printSuccess(String successMessage)
printSuccess
in class Console
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)
Console
Console.printSuccess(String)
printSuccess
in class Console
public void printErrorText(String message)
Console
printErrorText
in class Console
public void printErrorText(String message, Object... args)
Console
Console.printErrorText(String)
printErrorText
in class Console
public void printBuildFailure(String failureMessage)
Console
BUILD FAILED
to stderr that will be highlighted
in red if stderr is a tty.printBuildFailure
in class Console
public void printFailure(String failureMessage)
Console
printFailure
in class Console