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?
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.