-
Notifications
You must be signed in to change notification settings - Fork 2k
core/capabilities: reduce long log lines #21579
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
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,7 +46,7 @@ var defaultStreamConfig = p2ptypes.StreamConfig{ | |
|
|
||
| type launcher struct { | ||
| services.StateMachine | ||
| lggr logger.Logger | ||
| lggr logger.SugaredLogger | ||
| myPeerID p2ptypes.PeerID | ||
| peerWrapper p2ptypes.PeerWrapper | ||
| dispatcher remotetypes.Dispatcher | ||
|
|
@@ -106,7 +106,7 @@ func NewLauncher( | |
| return nil, fmt.Errorf("failed to create launcher metrics: %w", err) | ||
| } | ||
| return &launcher{ | ||
| lggr: logger.Named(lggr, "CapabilitiesLauncher"), | ||
| lggr: logger.Sugared(lggr).Named("CapabilitiesLauncher"), | ||
| peerWrapper: peerWrapper, | ||
| dispatcher: dispatcher, | ||
| cachedShims: cachedShims{ | ||
|
|
@@ -342,9 +342,12 @@ func (w *launcher) OnNewRegistry(ctx context.Context, localRegistry *registrysyn | |
| for family := range myDONFamiliesSet { | ||
| myDONFamilies = append(myDONFamilies, family) | ||
| } | ||
| w.lggr.Debugw("Found my DON families", "count", len(myDONFamilies), "myDONFamilies", myDONFamilies) | ||
| w.lggr.Debugw("Found my workflow DONs", "count", len(myWorkflowDONs), "myWorkflowDONs", myWorkflowDONs) | ||
| w.lggr.Debugw("Found all remote workflow DONs", "count", len(remoteWorkflowDONs), "remoteWorkflowDONs", remoteWorkflowDONs) | ||
| w.lggr.Debugw("Found my DON families", "count", len(myDONFamilies)) | ||
| w.lggr.Tracew("My DON families", "myDONFamilies", myDONFamilies) | ||
| w.lggr.Debugw("Found my workflow DONs", "count", len(myWorkflowDONs)) | ||
| w.lggr.Tracew("My workflow DONs", "myWorkflowDONs", myWorkflowDONs) | ||
| w.lggr.Debugw("Found all remote workflow DONs", "count", len(remoteWorkflowDONs)) | ||
| w.lggr.Tracew("All remote workflow DONs", "remoteWorkflowDONs", remoteWorkflowDONs) | ||
|
|
||
| // Capability DONs (with IsPublic = true) the current node is a part of. | ||
| // These need server-side shims to expose my own capabilities externally. | ||
|
|
@@ -359,14 +362,18 @@ func (w *launcher) OnNewRegistry(ctx context.Context, localRegistry *registrysyn | |
| } | ||
| } | ||
| } | ||
| w.lggr.Debugw("Found my capability DONs", "count", len(myCapabilityDONs), "myCapabilityDONs", myCapabilityDONs) | ||
| w.lggr.Debugw("Found all remote capability DONs", "count", len(remoteCapabilityDONs), "remoteCapabilityDONs", remoteCapabilityDONs) | ||
| w.lggr.Debugw("Found my capability DONs", "count", len(myCapabilityDONs)) | ||
| w.lggr.Tracew("My capability DONs", "myCapabilityDONs", myCapabilityDONs) | ||
| w.lggr.Debugw("Found all remote capability DONs", "count", len(remoteCapabilityDONs)) | ||
| w.lggr.Tracew("All remote capability DONs", "remoteCapabilityDONs", remoteCapabilityDONs) | ||
|
|
||
| if len(myDONFamilies) > 0 { | ||
| remoteWorkflowDONs = filterDONsByFamilies(remoteWorkflowDONs, myDONFamilies) | ||
| remoteCapabilityDONs = filterDONsByFamilies(remoteCapabilityDONs, myDONFamilies) | ||
| w.lggr.Debugw("Filtered remote workflow DONs to my families", "count", len(remoteWorkflowDONs), "remoteWorkflowDONs", remoteWorkflowDONs) | ||
| w.lggr.Debugw("Filtered remote capability DONs to my families", "count", len(remoteCapabilityDONs), "remoteCapabilityDONs", remoteCapabilityDONs) | ||
|
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. 35KiB |
||
| w.lggr.Debugw("Filtered remote workflow DONs to my families", "count", len(remoteWorkflowDONs)) | ||
| w.lggr.Tracew("Filtered remote workflow DONs to my families", "remoteWorkflowDONs", remoteWorkflowDONs) | ||
| w.lggr.Debugw("Filtered remote capability DONs to my families", "count", len(remoteCapabilityDONs)) | ||
| w.lggr.Tracew("Filtered remote capability DONs to my families", "remoteCapabilityDONs", remoteCapabilityDONs) | ||
| } else { | ||
| // legacy / Keystone setting | ||
| w.lggr.Debug("My node doesn't belong to any DON families. No filtering will be applied.") | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,7 +106,7 @@ type Report struct { | |
| // dependencies | ||
| balance *balanceStore | ||
| client BillingClient | ||
| lggr logger.Logger | ||
| lggr logger.SugaredLogger | ||
| metrics *monitoring.WorkflowsMetricLabeler | ||
|
|
||
| // internal state | ||
|
|
@@ -676,7 +676,8 @@ func (r *Report) EmitReceipt(ctx context.Context) error { | |
|
|
||
| rpt := r.FormatReport() | ||
|
|
||
| r.lggr.Debug("Emitting metering report", "report", rpt, "stepRefs", strings.Join(r.stepRefLookup, ",")) | ||
|
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. 16KiB |
||
| r.lggr.Debug("Emitting metering report") | ||
| r.lggr.Tracew("Metering report", "report", rpt, "stepRefs", strings.Join(r.stepRefLookup, ",")) | ||
|
|
||
| return wfEvents.EmitMeteringReport(ctx, r.labels, rpt) | ||
| } | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
38KiB