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

Allow plugins to transform the BuildListener log output.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Hudson 1.369
    • Similar Issues:

      Description

      This will be used by the Timestamper plugin to insert a timestamp on each line of the BuildListener output. (Currently it modifies the launcher output instead, which can have unwanted side-effects such as JENKINS-7111.)


      Preferred Approach (JENKINS-7112_decorateLogger.patch)
      Add a decorateLogger method to the BuildWrapper class, which can be optionally overridden to wrap the BuildListener's default logger.


      Alternate Approach (JENKINS-7112.patch)
      Add a decorateBuildListener method to the BuildWrapper class, which can be optionally overridden to wrap the default BuildListener. I have decided to not use this approach, since:

      • Other than wrapping the logger, it doesn't seem useful for plugins to alter the behaviour of the BuildListener.
      • It would make it more difficult to evolve the BuildListener interface in future.

      Both patches were created from the directory:
      https://hudson.dev.java.net/svn/hudson/trunk/hudson/main/core/

      Will ask for feedback from the dev mailing list before proceeding.

        Attachments

          Issue Links

            Activity

            stevengbrown Steven G Brown created issue -
            StevenGBrown StevenGBrown made changes -
            Field Original Value New Value
            Attachment JENKINS-7112.patch [ 19631 ]
            StevenGBrown StevenGBrown made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            dhaun Dirk Haun made changes -
            Link This issue is blocking JENKINS-7111 [ JENKINS-7111 ]
            StevenGBrown StevenGBrown made changes -
            Attachment JENKINS-7112_decorateLogger.patch [ 19644 ]
            StevenGBrown StevenGBrown made changes -
            Description Add a {{decorateBuildListener}} method to the {{BuildWrapper}} class, which can be optionally overridden to wrap the default {{BuildListener}}.

            See the attached patch for the proposed implementation. Patch was created from the directory: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main/core/

            This will be used by the {{Timestamper}} plugin to insert a timestamp on each line of the {{BuildListener}} output. (Currently it modifies the launcher output instead, which can have unwanted side-effects such as JENKINS-7111.)

            Will ask for feedback from the dev mailing list before proceeding.
            This will be used by the {{Timestamper}} plugin to insert a timestamp on each line of the {{BuildListener}} output. (Currently it modifies the launcher output instead, which can have unwanted side-effects such as JENKINS-7111.)

            -----

            *Preferred Approach* ({{JENKINS-7112_decorateLogger.patch}})
            Add a {{decorateLogger}} method to the {{BuildWrapper}} class, which can be optionally overridden to wrap the {{BuildListener}}'s default logger.

            -----

            *Alternate Approach* ({{JENKINS-7112.patch}})
            Add a {{decorateBuildListener}} method to the {{BuildWrapper}} class, which can be optionally overridden to wrap the default {{BuildListener}}. I have decided to not use this approach, since:
            * Other than wrapping the logger, it doesn't seem useful for plugins to alter the behaviour of the {{BuildListener}}.
            * It would make it more difficult to evolve the {{BuildListener}} interface in future.

            -----

            Both patches were created from the directory:
            https://hudson.dev.java.net/svn/hudson/trunk/hudson/main/core/

            Will ask for feedback from the dev mailing list before proceeding.
            Hide
            StevenGBrown StevenGBrown added a comment -

            Reminder: The @since tag may need to be updated before committing.

            Show
            StevenGBrown StevenGBrown added a comment - Reminder: The @since tag may need to be updated before committing.
            Show
            StevenGBrown StevenGBrown added a comment - http://hudson.361315.n4.nabble.com/Review-BuildWrapper-decorateLogger-tp2322937p2322937.html
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in hudson
            User: : StevenGBrown
            Path:
            trunk/hudson/main/core/src/main/java/hudson/model/Run.java
            trunk/hudson/main/core/src/main/java/hudson/tasks/BuildWrapper.java
            trunk/www/changelog.html
            http://jenkins-ci.org/commit/34008
            Log:
            [FIXED JENKINS-7112] Plugins can now transform the console output.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : StevenGBrown Path: trunk/hudson/main/core/src/main/java/hudson/model/Run.java trunk/hudson/main/core/src/main/java/hudson/tasks/BuildWrapper.java trunk/www/changelog.html http://jenkins-ci.org/commit/34008 Log: [FIXED JENKINS-7112] Plugins can now transform the console output.
            scm_issue_link SCM/JIRA link daemon made changes -
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Resolved [ 5 ]
            Hide
            dogfood dogfood added a comment -

            Integrated in hudson_main_trunk #201
            [FIXED JENKINS-7112] Plugins can now transform the console output.

            StevenGBrown :
            Files :

            • /trunk/www/changelog.html
            • /trunk/hudson/main/core/src/main/java/hudson/model/Run.java
            • /trunk/hudson/main/core/src/main/java/hudson/tasks/BuildWrapper.java
            Show
            dogfood dogfood added a comment - Integrated in hudson_main_trunk #201 [FIXED JENKINS-7112] Plugins can now transform the console output. StevenGBrown : Files : /trunk/www/changelog.html /trunk/hudson/main/core/src/main/java/hudson/model/Run.java /trunk/hudson/main/core/src/main/java/hudson/tasks/BuildWrapper.java
            stevengbrown Steven G Brown made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 137209 ] JNJira + In-Review [ 204426 ]

              People

              Assignee:
              stevengbrown Steven G Brown
              Reporter:
              stevengbrown Steven G Brown
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: