Disable log in runtime

24 views
Skip to first unread message

Marcin Matuła

unread,
Nov 2, 2017, 7:08:29 AM11/2/17
to Jenkins Users
Hi,

print method in Cause.java class:

private void print(TaskListener listener, int depth) {
    indent
(listener, depth);
    listener
.getLogger().println(
       
Messages.Cause_UpstreamCause_ShortDescription(
           
ModelHyperlinkNote.encodeTo('/' + upstreamUrl, upstreamProject),
           
ModelHyperlinkNote.encodeTo('/'+upstreamUrl+upstreamBuild, Integer.toString(upstreamBuild)))
   
);
   
if (upstreamCauses != null && !upstreamCauses.isEmpty()) {
        indent
(listener, depth);
        listener
.getLogger().println(Messages.Cause_UpstreamCause_CausedBy());
       
for (Cause cause : upstreamCauses) {
           
if (cause instanceof UpstreamCause) {
               
((UpstreamCause) cause).print(listener, depth + 1);
           
} else {
                indent
(listener, depth + 1);
                cause
.print(listener);
           
}
       
}  
   
}
}


produces too long log in my configuration (too much upstream projects).

How this log can be disabled? Is any way to provide my own listener with empty implementation?
Any other way?

Br,
Marcin

Marcin Matuła

unread,
Nov 2, 2017, 7:13:23 AM11/2/17
to Jenkins Users

Is any way to provide my own listener with empty implementation
 in the runtime

Marcin Matuła

unread,
Nov 6, 2017, 6:09:03 AM11/6/17
to Jenkins Users
Reply all
Reply to author
Forward
0 new messages