Writing a stream of logs from a shared library so they appear under one collapsible panel in Blue Ocean

19 views
Skip to first unread message

Peter Goodman

unread,
May 27, 2019, 7:37:43 AM5/27/19
to Jenkins Users
Hi,
So I have written some Groovy code in a shared library. I want that library to be able to write lots of logs (by polling an external api for the service I am integrating).

However, if I use echo or println they appear as new sections in the Blue Ocean UI.

echo_in_blue_ocean.png


What I want though is something more like the shell task output where it is under a single grouping/section and I can keep appending inside the section as I fetch more logs from the ongoing job in the external api.


I've tried getting a hold of TaskListener with getLogger but no joy.


Any ideas?



Baptiste Mathus

unread,
May 31, 2019, 7:35:41 AM5/31/19
to jenkins...@googlegroups.com
Seems like a case where writing a plugin is the way if you want fine-tuning like this.
Shared libraries are still /userspace/ side when using Pipeline. When needing to go deeper and get holds off more internal structure, shared libs are not a fit anymore.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/60b3373f-a294-4923-bdbe-48037722943d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages