Need help on writing logs in console log.

19 views
Skip to first unread message

prabhakar gurram

unread,
Jan 23, 2019, 9:16:42 AM1/23/19
to Jenkins Developers
Hi All,

I are doing plugin logging work currently in JAVA. We are receiving task listener object from perform method but same object not able to pass to other package classes which will be imported through POM dependencies.

Example:

I have a plugin code like  below.

Class A{

public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath filePath, @Nonnull Launcher launcher, @Nonnull TaskListener taskListener) throws InterruptedException, IOException {



Now taskListener object will work in current class A object and prints output.

But when import code from xyz.jar and pass the taskListener to xyz.jar Class B then it gives null pointer exception.

My aim is to print the xyz.jar logs in console output.

Could anyone please help me achieving this? Are there any documentation or exiting code will be helpful to me.

Thank you,
Prabhakar.

Ullrich Hafner

unread,
Jan 23, 2019, 11:39:51 AM1/23/19
to Jenkins Developers
If you get a NPE then you did not pass the taskListener correctly. Did you try to debug your problem? There is no documentation that can help you here...

--
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 jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/b0ae045c-3ece-4405-8efe-c719cf6ebeb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

prabhakar gurram

unread,
Jan 23, 2019, 11:49:30 AM1/23/19
to jenkin...@googlegroups.com
Yes I tried to debug that. I am able to print object before passing after passing it shows as null

Ulli Hafner

unread,
Jan 23, 2019, 12:36:40 PM1/23/19
to jenkin...@googlegroups.com
It would help if you would show the code

Von meinem iPad gesendet
Reply all
Reply to author
Forward
0 new messages