Class LogLastLinesProcessListener
- java.lang.Object
-
- jetbrains.buildServer.agent.runner.ProcessListenerAdapter
-
- jetbrains.buildServer.agent.runner.LogLastLinesProcessListener
-
- All Implemented Interfaces:
java.util.EventListener
,ProcessListener
public class LogLastLinesProcessListener extends ProcessListenerAdapter
Process listener which is able to add last process's output lines to the build log.
-
-
Constructor Summary
Constructors Constructor Description LogLastLinesProcessListener(java.lang.String runnerName, BuildProgressLogger buildLogger, int maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onErrorOutput(java.lang.String text)
process error outputvoid
onStandardOutput(java.lang.String text)
process standard outputvoid
processFinished(int exitCode)
Process finished, terminated or failed to start.protected boolean
shouldLogLines(int exitCode)
By defaults, return true iff process exit code is != 0-
Methods inherited from class jetbrains.buildServer.agent.runner.ProcessListenerAdapter
processStarted
-
-
-
-
Constructor Detail
-
LogLastLinesProcessListener
public LogLastLinesProcessListener(java.lang.String runnerName, BuildProgressLogger buildLogger, int maxSize)
-
-
Method Detail
-
onStandardOutput
public void onStandardOutput(@NotNull java.lang.String text)
Description copied from interface:ProcessListener
process standard output- Specified by:
onStandardOutput
in interfaceProcessListener
- Overrides:
onStandardOutput
in classProcessListenerAdapter
- Parameters:
text
- process stdout output text
-
onErrorOutput
public void onErrorOutput(@NotNull java.lang.String text)
Description copied from interface:ProcessListener
process error output- Specified by:
onErrorOutput
in interfaceProcessListener
- Overrides:
onErrorOutput
in classProcessListenerAdapter
- Parameters:
text
- process stderr output text
-
processFinished
public void processFinished(int exitCode)
Description copied from interface:ProcessListener
Process finished, terminated or failed to start. Called only ifProcessListener.processStarted(String, java.io.File)
was called before- Specified by:
processFinished
in interfaceProcessListener
- Overrides:
processFinished
in classProcessListenerAdapter
- Parameters:
exitCode
- resulting exit code of the process
-
shouldLogLines
protected boolean shouldLogLines(int exitCode)
By defaults, return true iff process exit code is != 0- Parameters:
exitCode
- process exit code- Returns:
- true if last lines should be added to build log, false otherwise
-
-