diff --git a/src/main/java/hudson/plugins/ansicolor/action/ColorizedAction.java b/src/main/java/hudson/plugins/ansicolor/action/ColorizedAction.java index a480956..6a08cfd 100644 --- a/src/main/java/hudson/plugins/ansicolor/action/ColorizedAction.java +++ b/src/main/java/hudson/plugins/ansicolor/action/ColorizedAction.java @@ -31,6 +31,7 @@ import java.util.Optional; import java.util.UUID; +import java.util.logging.Logger; import static hudson.plugins.ansicolor.action.ActionNote.TAG_ACTION_BEGIN; @@ -38,6 +39,7 @@ * Action for issuing commands to ColorConsoleAnnotator */ public class ColorizedAction extends InvisibleAction { + private static final Logger LOGGER = Logger.getLogger(ColorizedAction.class.getName()); private static final String TAG_PIPELINE_INTERNAL = " run) { if (line.contains(TAG_PIPELINE_INTERNAL)) { return IGNORE; } - - if (run.isBuilding()) { + final boolean isBuilding = run.isBuilding(); + LOGGER.fine("Run is building: " + isBuilding); + if (isBuilding) { Optional currentAction = run.getActions(ColorizedAction.class).stream() .filter(a -> Command.CURRENT.equals(a.getCommand())) .findFirst(); diff --git a/src/test/java/hudson/plugins/ansicolor/AnsiColorStepTest.java b/src/test/java/hudson/plugins/ansicolor/AnsiColorStepTest.java index 603c9c5..69b0b55 100644 --- a/src/test/java/hudson/plugins/ansicolor/AnsiColorStepTest.java +++ b/src/test/java/hudson/plugins/ansicolor/AnsiColorStepTest.java @@ -147,7 +147,7 @@ public void canRenderLongOutputWhileBuildStillRunning() { public void evaluate() throws Throwable { final String a1k = JenkinsTestSupport.repeat("a", 1024); final String script = "ansiColor('xterm') {\n" + - "for (i = 0; i < 500; i++) {" + + "for (i = 0; i < 1000; i++) {" + "echo '\033[32m" + a1k + "\033[0m'\n" + "}" + "}";