I finally managed it to implement a block scoped step. Currently I invoke the 
body of the step using this API

                getContext().newBodyInvoker()
                        .withContext(new ConsoleLogSplitter(…)) // implements 
TaskListenerDecorator and writes the output to a temporary file
                        .withCallback(new RecordIssuesCallback(…)) // extends 
BodyExecutionCallback and reads the temporary file to extract the warnings 
                        .start();

My TaskListenerDecorator instance is now invoked for every line in the body of 
my step. Is there a similar API to get the whole log of the body instead? Or do 
I need to concatenate the log on my own? 



> Am 15.01.2019 um 17:18 schrieb Jesse Glick <[email protected]>:
> 
> On Mon, Jan 14, 2019 at 6:34 PM Ullrich Hafner <[email protected]> 
> 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 [email protected].
> 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.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/3CB23E4E-649B-4D65-B020-BE3343A88CF8%40gmail.com.

Reply via email to