public abstract class AbstractLogCommandOutput extends Object implements LogCommandOutput
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractLogCommandOutput.DebugLogCommandOutput
Logs the output as debug level.
|
static class |
AbstractLogCommandOutput.ErrorLogCommandOutput
Logs the output as error level.
|
static class |
AbstractLogCommandOutput.InfoLogCommandOutput
Logs the output as info level.
|
static class |
AbstractLogCommandOutput.TraceLogCommandOutput
Logs the output as trace level.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractLogCommandOutput(org.slf4j.Logger logger,
CommandLine commandLine) |
| Modifier and Type | Method and Description |
|---|---|
CommandOutput |
call()
Reads the standard output from the connected stream.
|
abstract CommandOutput |
clone()
Clones the standard output reader.
|
static CommandOutput |
createDebugLogCommandOutput(org.slf4j.Logger logger,
CommandLine commandLine) |
static CommandOutput |
createErrorLogCommandOutput(org.slf4j.Logger logger,
CommandLine commandLine) |
static CommandOutput |
createInfoLogCommandOutput(org.slf4j.Logger logger,
CommandLine commandLine) |
static CommandOutput |
createTraceLogCommandOutput(org.slf4j.Logger logger,
CommandLine commandLine) |
String |
getCommand()
Returns the command for the logging message.
|
CommandLine |
getCommandLine()
Returns the command line for the logging message.
|
InputStream |
getInput()
Returns the stream that is connected to output of the executed command.
|
org.slf4j.Logger |
getLogger()
Returns the logger that is filled with the piped to the output of the
command.
|
String |
getMessage()
Returns the message string.
|
protected abstract void |
logLine(String line)
Log the line red from the command output.
|
void |
setBufferSize(int size)
Sets the buffer size.
|
void |
setInput(InputStream stream)
Sets the stream that is connected to output of the executed command.
|
void |
setLogger(org.slf4j.Logger logger)
Sets the logger that is filled with the piped to the output of the
command.
|
void |
setMessage(String message)
Sets the message string.
|
String |
toString() |
protected AbstractLogCommandOutput(org.slf4j.Logger logger,
CommandLine commandLine)
logger - the Logger.commandLine - the the CommandLine for the logging message.public static CommandOutput createInfoLogCommandOutput(org.slf4j.Logger logger, CommandLine commandLine)
CommandOutput#create(Logger, CommandLine)public static CommandOutput createDebugLogCommandOutput(org.slf4j.Logger logger, CommandLine commandLine)
CommandOutput#create(Logger, CommandLine)public static CommandOutput createTraceLogCommandOutput(org.slf4j.Logger logger, CommandLine commandLine)
CommandOutput#create(Logger, CommandLine)public static CommandOutput createErrorLogCommandOutput(org.slf4j.Logger logger, CommandLine commandLine)
CommandOutput#create(Logger, CommandLine)public void setInput(InputStream stream)
CommandOutputsetInput in interface CommandOutputstream - the InputStream.public InputStream getInput()
LogCommandOutputgetInput in interface LogCommandOutputInputStream.public void setBufferSize(int size)
LogCommandOutputsetBufferSize in interface LogCommandOutputsize - the size in bytes.public void setLogger(org.slf4j.Logger logger)
LogCommandOutputsetLogger in interface LogCommandOutputlogger - the Logger.public org.slf4j.Logger getLogger()
LogCommandOutputgetLogger in interface LogCommandOutputLogger.public CommandLine getCommandLine()
LogCommandOutputgetCommandLine in interface LogCommandOutputCommandLine.public String getCommand()
LogCommandOutputgetCommand in interface LogCommandOutputString command.public void setMessage(String message)
LogCommandOutputsetMessage in interface LogCommandOutputmessage - the String message.public String getMessage()
LogCommandOutputgetMessage in interface LogCommandOutputString message.public CommandOutput call() throws Exception
CommandOutputcall in interface CommandOutputcall in interface Callable<CommandOutput>Exceptionpublic abstract CommandOutput clone()
CommandOutputclone in interface CommandOutputclone in class ObjectCommandOutput.protected abstract void logLine(String line)
line - the String line.Copyright © 2014–2016. All rights reserved.