Class LogLastLinesProcessListener
- java.lang.Object
-
- jetbrains.buildServer.agent.runner.ProcessListenerAdapter
-
- jetbrains.buildServer.agent.runner.LogLastLinesProcessListener
-
- All Implemented Interfaces:
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(String runnerName, BuildProgressLogger buildLogger, int maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonErrorOutput(String text)process error outputvoidonStandardOutput(String text)process standard outputvoidprocessFinished(int exitCode)Process finished, terminated or failed to start.protected booleanshouldLogLines(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(String runnerName, BuildProgressLogger buildLogger, int maxSize)
-
-
Method Detail
-
onStandardOutput
public void onStandardOutput(@NotNull String text)Description copied from interface:ProcessListenerprocess standard output- Specified by:
onStandardOutputin interfaceProcessListener- Overrides:
onStandardOutputin classProcessListenerAdapter- Parameters:
text- process stdout output text
-
onErrorOutput
public void onErrorOutput(@NotNull String text)Description copied from interface:ProcessListenerprocess error output- Specified by:
onErrorOutputin interfaceProcessListener- Overrides:
onErrorOutputin classProcessListenerAdapter- Parameters:
text- process stderr output text
-
processFinished
public void processFinished(int exitCode)
Description copied from interface:ProcessListenerProcess finished, terminated or failed to start. Called only ifProcessListener.processStarted(String, java.io.File)was called before- Specified by:
processFinishedin interfaceProcessListener- Overrides:
processFinishedin 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
-
-