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

Allow plugins to transform the BuildListener log output.

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Hudson 1.369

      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.

          [JENKINS-7112] Allow plugins to transform the BuildListener log output.

          Steven G Brown created issue -
          StevenGBrown made changes -
          Attachment New: JENKINS-7112.patch [ 19631 ]
          StevenGBrown made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Dirk Haun made changes -
          Link New: This issue is blocking JENKINS-7111 [ JENKINS-7111 ]
          StevenGBrown made changes -
          Attachment New: JENKINS-7112_decorateLogger.patch [ 19644 ]
          StevenGBrown made changes -
          Description Original: 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.
          New: 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.
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Steven G Brown made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 137209 ] New: JNJira + In-Review [ 204426 ]

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

              Created:
              Updated:
              Resolved: