Disable log in runtime

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Disable log in runtime

Marcin Matuła
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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d328ef89-d4b7-40ef-a1a4-c13719ec7381%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Disable log in runtime

Marcin Matuła

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


W dniu czwartek, 2 listopada 2017 12:08:29 UTC+1 użytkownik Marcin Matuła napisał:
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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a2f2b311-fccf-4e7d-9d65-c5ae984440d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Disable log in runtime

Marcin Matuła
Response: should be used http://javadoc.jenkins.io/hudson/console/ConsoleLogFilter.html

W dniu czwartek, 2 listopada 2017 12:13:23 UTC+1 użytkownik Marcin Matuła napisał:

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


W dniu czwartek, 2 listopada 2017 12:08:29 UTC+1 użytkownik Marcin Matuła napisał:
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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a0d37c25-3cdb-4cb2-a600-88c4c25a3a82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.