Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34019

ANSIColor plugin leaks format onto next line's timestamp

      When used with timestamped console output, the formatting from one line sometimes (but not always) leaks over and colors the timestamp on the next line.

        1. consolelog.png
          consolelog.png
          323 kB
        2. with.png
          with.png
          8 kB
        3. without.png
          without.png
          6 kB

          [JENKINS-34019] ANSIColor plugin leaks format onto next line's timestamp

          Changes were reverted for Timestamper 1.8.7. Overriding the style works fine for the default Jenkins theme, but clashes with custom themes.

          This can be fixed instead within the AnsiColor plugin by:

          1. Using a ConsoleAnnotatorFactory instead of inserting console notes into the log file.
          2. When a style continues to the next line, the ConsoleAnnotatorFactory can insert a closing tag at the end of the line and an opening tag at the beginning of the next line. This prevents the timestamps from being affected.

          Steven G Brown added a comment - Changes were reverted for Timestamper 1.8.7. Overriding the style works fine for the default Jenkins theme, but clashes with custom themes. This can be fixed instead within the AnsiColor plugin by: Using a ConsoleAnnotatorFactory instead of inserting console notes into the log file. When a style continues to the next line, the ConsoleAnnotatorFactory can insert a closing tag at the end of the line and an opening tag at the beginning of the next line. This prevents the timestamps from being affected.

          Would be nice to see this fixed if possible...

          Simon Wydooghe added a comment - Would be nice to see this fixed if possible...

          I have provided instructions to reproduce and fix. Pull requests welcome.

          Steven G Brown added a comment - I have provided instructions to reproduce and fix. Pull requests welcome.

          Jesse Glick added a comment -

          PR 132 may be a good starting point.

          Jesse Glick added a comment - PR 132 may be a good starting point.

          Devin Nusbaum added a comment -

          PR 132 may be a good starting point.

          PR 132 was just released in Ansicolor 0.6.0, so it would be good if someone who is seeing this issue can confirm whether that version improves the situation.

          Devin Nusbaum added a comment - PR 132 may be a good starting point. PR 132 was just released in Ansicolor 0.6.0, so it would be good if someone who is seeing this issue can confirm whether that version improves the situation.

          Jesse Glick added a comment -

          IIUC it was more that switching to a console annotator was expected to make it easier to fix this, as outlined in the note of 2016-10-04.

          Jesse Glick added a comment - IIUC it was more that switching to a console annotator was expected to make it easier to fix this, as outlined in the note of 2016-10-04.

          We have an issue where [0m (aka setaf 0) is being printed to the screen at the end of a line with color and timestamps. This messes up the color for all future lines, though the timestamps themselves are okay.

          Christian Höltje added a comment - We have an issue where [0m (aka setaf 0 ) is being printed to the screen at the end of a line with color and timestamps. This messes up the color for all future lines, though the timestamps themselves are okay.

          Jesse Glick added a comment -

          Recheck after PR 137 (unreleased as of this writing).

          Jesse Glick added a comment - Recheck after PR 137 (unreleased as of this writing).

          Devin Nusbaum added a comment -

          And if PR 137 doesn't help, it would be worth checking if PR 147 makes a difference.

          Devin Nusbaum added a comment - And if PR 137 doesn't help, it would be worth checking if  PR 147 makes a difference.

          Noam Manos added a comment -

          As a workaround, when the timestamper background is white, while the console was set to black in Ansi-Color plugin,

          you can use  https://github.com/jazzzz/jenkins-black-console to configure the default CSS to black.

           

          All you need is to install Simple Theme Plugin and configure in "Manage Jenkins" this theme:

          https://jazzzz.github.io/jenkins-black-console/black-console.css

          Noam Manos added a comment - As a workaround, when the timestamper background is white, while the console was set to black in Ansi-Color plugin, you can use   https://github.com/jazzzz/jenkins-black-console to configure the default CSS to black.   All you need is to install  Simple Theme Plugin and configure in "Manage Jenkins" this theme: https://jazzzz.github.io/jenkins-black-console/black-console.css

            Unassigned Unassigned
            evildeece Alastair D'Silva
            Votes:
            5 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: