Reading console log of parallel stages

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading console log of parallel stages

Ulli Hafner
If a pipeline contains parallel stages, then the console log will contain an unordered mix of stdout messages of all parallel stages. This makes it impossible to decided which log message is from which parallel stage if I access the log using Run.getLogReader().

Since a couple of weeks the console log view shows in the frame border which log message is from which parallel stage, so it is somehow possible to obtain that information. Which API can I use to read the individual console log information of a parallel stage?

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/50959DF5-2CB4-45AA-9BF3-5292F535587A%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Reading console log of parallel stages

Jesse Glick-4
On Mon, Jan 14, 2019 at 6:34 PM Ullrich Hafner <[hidden email]> wrote:
> Which API can I use to read the individual console log information of a parallel stage?

There is not an API exactly for that, but you can use various
techniques in `workflow-api` like `FlowScanner` to get the set of
`FlowNode`s in the branch, and you can use `LogAction` (if present) to
retrieve any log text associated with that node.

I think I mentioned at some point that a simpler and more efficient
way to process log messages is to use a block-scoped step, which can
then contextualize a `ConsoleLogFilter` (freestyle-compatible but
clunky) or `TaskListenerDecorator` (Pipeline-specific but cleaner)
that passes through log lines after tallying them for warnings or
whatever, with no need to ever read the build log later.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr1F11wKsJtfsUWy4h3ErgvxmyM4BQVrY-gGNZtb9WwgQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.