-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JENKINS-55194 Add logLevel to support debugging and also reduce default excessive logging #12
Conversation
…lt excessive logging
|
||
|logLevel | ||
|String | ||
a|Defaults to *SEVERE* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the a
supposed to be at the start of this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is actually asciidoc syntax to support asciidoc content in column (list in this case)
https://asciidoctor.org/docs/user-manual/#cols-format
Look for the string below to find the table
The column styles are described in the table below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice. I wondered if it might be related to the list.
if(remote.appendName) { | ||
interaction = { | ||
when(line: _, from: standardOutput) { | ||
logger.println("$remote.name|$it") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we do something like this instead so we don't repeat as much?
logger.println("$remote.name|$it") | |
def logPrefix = remote.appendName ? "$remote.name|" : '' | |
interaction = { | |
when(line: _, from: standardOutput) { | |
logger.println("$logPrefix$it") | |
} | |
when(line: _, from: standardError) { | |
logger.println("$logPrefix$it") | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, let me update it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with ce8bccb and also tested by deploying change on a local Jenkins again.
Thank you @ghenkes for a quick review. :) |
try { | ||
Level.parse(remote.logLevel) | ||
} catch (IllegalArgumentException e) { | ||
throw new IllegalArgumentException(getPrefix() + "Bad log level $remote.logLevel for $remote.name") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the original exception here?
throw new IllegalArgumentException(getPrefix() + "Bad log level $remote.logLevel for $remote.name") | |
throw new IllegalArgumentException(getPrefix() + "Bad log level $remote.logLevel for $remote.name", e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it was IllegalArgumentException itself, I don't think adding e would add much value.
@@ -38,6 +40,9 @@ class Common { | |||
validateUserAuthentication(remote) | |||
validateHostAuthentication(remote) | |||
validateProxyConnection(remote) | |||
if(remote.logLevel) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add space between if (
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, let me update it quickly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with b74eb7b
if(remote.logLevel) { | ||
rootLogger.setLevel(Level.parse(remote.logLevel)) | ||
} else { | ||
rootLogger.setLevel(Level.SEVERE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there much noise in org.hidetake to pick a default log level this high?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intention was to turn off the logging by default and leave it to the consumer to increase it based on the needs.
Description
JENKINS-55194 Add logLevel to support debugging and also reduce default excessive logging
See JENKINS-55194.