-
Notifications
You must be signed in to change notification settings - Fork 41
Add diff logic and parallel logger support for audit #642
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
base: dev
Are you sure you want to change the base?
Changes from all commits
18c22a1
6c07738
caf59eb
7fc3bd0
96ae51a
b22d7c4
16f7f21
c38b6c3
5e4a231
86e70fd
37f3743
b0eb167
957b363
809a52f
a5897a9
22f7713
56609db
816605d
1ca4a0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package audit | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe this should be at jfrog/jfrog-client-go#1297?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are the options Move LogCollector to client-go - but it's really just a wrapper or we Keep it as is
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing code from repo is always good :) |
||
|
|
||
| import ( | ||
| "github.com/jfrog/jfrog-client-go/utils/log" | ||
| ) | ||
|
|
||
| // LogCollector captures logs for isolated parallel audit operations. | ||
| type LogCollector struct { | ||
| logger *log.BufferedLogger | ||
| } | ||
|
|
||
| func NewLogCollector(level log.LevelType) *LogCollector { | ||
| return &LogCollector{ | ||
| logger: log.NewBufferedLogger(level), | ||
| } | ||
| } | ||
|
|
||
| func (c *LogCollector) Logger() log.Log { | ||
| return c.logger | ||
| } | ||
|
|
||
| // ReplayTo outputs captured logs through the target logger (preserving colors). | ||
| func (c *LogCollector) ReplayTo(target log.Log) { | ||
| c.logger.ReplayTo(target) | ||
| } | ||
|
|
||
| func (c *LogCollector) HasLogs() bool { | ||
| return c.logger.Len() > 0 | ||
| } | ||
|
|
||
| func (c *LogCollector) Len() int { | ||
| return c.logger.Len() | ||
| } | ||
|
|
||
| func (c *LogCollector) String() string { | ||
| return c.logger.String() | ||
| } | ||
|
|
||
| func (c *LogCollector) Clear() { | ||
| c.logger.Clear() | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| module github.com/jfrog/jfrog-cli-security | ||
|
|
||
| go 1.25.4 | ||
| go 1.25.5 | ||
|
|
||
| require ( | ||
| github.com/CycloneDX/cyclonedx-go v0.9.3 | ||
|
|
@@ -11,7 +11,7 @@ require ( | |
| github.com/gookit/color v1.6.0 | ||
| github.com/hashicorp/go-hclog v1.6.3 | ||
| github.com/hashicorp/go-plugin v1.6.3 | ||
| github.com/jfrog/build-info-go v1.12.5-0.20251209171349-eb030db986f9 | ||
| github.com/jfrog/build-info-go v1.13.0 | ||
| github.com/jfrog/froggit-go v1.20.6 | ||
| github.com/jfrog/gofrog v1.7.6 | ||
| github.com/jfrog/jfrog-apps-config v1.0.1 | ||
|
|
@@ -135,12 +135,12 @@ require ( | |
| gopkg.in/warnings.v0 v0.1.2 // indirect | ||
| ) | ||
|
|
||
| // replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go master | ||
|
|
||
| // replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 master | ||
|
|
||
| //replace github.com/jfrog/jfrog-cli-artifactory => github.com/jfrog/jfrog-cli-artifactory main | ||
|
|
||
| // replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go dev | ||
|
|
||
| // replace github.com/jfrog/froggit-go => github.com/jfrog/froggit-go master | ||
|
|
||
| replace github.com/jfrog/jfrog-client-go => github.com/eyalk007/jfrog-client-go v0.0.0-20260114112951-67b77f49255f | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reminder to remove replace after merging dependend PR |
||
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.
I think you can use
WrapTaskWithLoggerPropagationhere as well