-
Notifications
You must be signed in to change notification settings - Fork 310
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
chore(dos): Trivially improve logging multiple packages #9425
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9425 +/- ##
=========================================
Coverage 68.02% 68.02%
Complexity 1291 1291
=========================================
Files 250 250
Lines 8808 8808
Branches 916 916
=========================================
Hits 5992 5992
Misses 2431 2431
Partials 385 385
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -170,7 +170,8 @@ class DosScanner internal constructor( | |||
startTime: Instant, | |||
issues: MutableList<Issue> | |||
): ScanResultsResponseBody? { | |||
logger.info { "Initiating a backend scan for ${packages.map { it.purl }}." } | |||
logger.info { "Initiating a backend scan for the following packages:" } | |||
packages.forEach { logger.info { it.purl } } |
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.
For consistency it would be better to embed the packages into the log above, otherwise you have the package list with logger prefix for each line here, and without the prefix 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.
logger prefix for each line here
That was actually the intention of this change. I'm only not doing the same in line 202 as it's not possible with createAndLogIssue()
.
But as @mmurto also raised concerns about log filtering being harder this way, I'll change this to be like line 202.
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.
Another option would be to omit the first log and log the whole "Initiating package scan for ${it.purl}." inside the loop.
6cdf4a9
to
819ac1d
Compare
Signed-off-by: Sebastian Schuberth <[email protected]>
819ac1d
to
ae514c2
Compare
No description provided.