Skip to content

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

Description

@jenkins-infra-bot

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.


Originally reported by stevengbrown, imported from: Allow plugins to transform the BuildListener log output.
  • assignee: stevengbrown
  • status: Closed
  • priority: Major
  • component(s): core
  • resolution: Fixed
  • resolved: 2010-08-21T00:51:09+00:00
  • votes: 0
  • watchers: 2
  • imported: 2025-11-24
Raw content of original issue

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.

  • environment: Hudson 1.369
2 attachments

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions