-
Notifications
You must be signed in to change notification settings - Fork 414
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
Add additional logging for notification conditions #516
Conversation
Looks good, I'll try it out soon just to make sure it's fine |
src/main/java/jenkins/plugins/slack/decisions/OnBackToNormal.java
Outdated
Show resolved
Hide resolved
Here's an example log from running a build with all options ticked:
|
@sghill What do you think about moving some of those messages to the build log instead of the system log? I don't like how in freestyle projects its silent and you can't even tell its done anything |
(Code is good except for the missing null checks around previous build and tests around that) |
dddcc47
to
9b36578
Compare
Thanks for the quick review @timja! I updated the
I agree, that's a great idea.
I introduced a Here's an example of logs in the build (they include the plugin name so we know where they came from):
I moved the lifecycle messages to the FINE level. Here's an example of the system log at INFO level:
and at FINE level:
|
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.
Code looks great, thanks, Will merge if manual testing passes
Just the * imports and the question on the logger, otherwise code is good and will get 🚢'ed soon |
- Extracted Condition interface that let's us log both if the condition was met and if the user preference allowed the notification to be sent - Conditions that have interesting logic are unit-tested - Moves to the message supplier style of logging, which is not invoked unless that level of logging is enabled - Introduces a build key format - [ProjectFullDisplayName #<build>] to better indicate which build the messaging is coming from - Introduce SlackFactory in ActiveNotifier instead of passing in the dependencies to create a slack factory method - Introduce SlackNotificationsLogger - which writes to the system log with the build key embedded, and writes info-level messages to the build log with the plugin name embedded
9b36578
to
81af2d4
Compare
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.
LGTM, will merge after green build
was met and if the user preference allowed the notification to be sent
unless that level of logging is enabled
better indicate which build the messaging is coming from
Fixes #508