Skip to content
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

Clean up debug log level by moving many frequent logs to trace level #2004

Merged
merged 5 commits into from
Apr 3, 2022

Conversation

michaelsutton
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Apr 3, 2022

Codecov Report

Merging #2004 (194b99e) into dev (71afc62) will decrease coverage by 0.08%.
The diff coverage is 94.87%.

❗ Current head 194b99e differs from pull request most recent head 2f2a706. Consider uploading reports for the commit 2f2a706 to get more accurate results

@@            Coverage Diff             @@
##              dev    #2004      +/-   ##
==========================================
- Coverage   59.73%   59.64%   -0.09%     
==========================================
  Files         663      663              
  Lines       31552    31552              
==========================================
- Hits        18847    18820      -27     
- Misses      10025    10045      +20     
- Partials     2680     2687       +7     
Impacted Files Coverage Δ
infrastructure/logger/utils.go 62.50% <66.66%> (-37.50%) ⬇️
...in/consensus/processes/reachabilitymanager/tree.go 58.91% <75.00%> (ø)
app/protocol/flowcontext/blocks.go 69.47% <100.00%> (ø)
...sses/consensusstatemanager/add_block_to_virtual.go 78.72% <100.00%> (ø)
...esses/consensusstatemanager/calculate_past_utxo.go 65.74% <100.00%> (ø)
.../consensusstatemanager/check_finality_violation.go 72.22% <100.00%> (ø)
...s/consensusstatemanager/import_pruning_utxo_set.go 58.57% <100.00%> (ø)
...ensus/processes/consensusstatemanager/multisets.go 78.94% <100.00%> (ø)
...sses/consensusstatemanager/resolve_block_status.go 70.65% <100.00%> (ø)
...nsus/processes/consensusstatemanager/utxo_diffs.go 100.00% <100.00%> (ø)
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 71afc62...2f2a706. Read the comment docs.


unorphaningResults, err := f.UnorphanBlocks(block)
if err != nil {
return err
}

log.Debugf("OnNewBlock: block %s unorphaned %d blocks", hash, len(unorphaningResults))
log.Tracef("OnNewBlock: block %s unorphaned %d blocks", hash, len(unorphaningResults))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider changing to Debugf

@@ -79,11 +79,11 @@ func (flow *sendVersionFlow) start() error {
}

// Wait for verack
log.Debugf("Waiting for verack")
log.Tracef("Waiting for verack")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider changing to Debugf

_, err = flow.incomingRoute.DequeueWithTimeout(common.DefaultTimeout)
if err != nil {
return err
}
log.Debugf("Got verack")
log.Tracef("Got verack")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider changing to Debugf

}

// Update reindex root data store
rt.stageReindexRoot(stagingArea, newReindexRoot)
log.Debugf("Updated the reindex root to %s", newReindexRoot)
log.Tracef("Updated the reindex root to %s", newReindexRoot)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change to Debugf?

}
}

// LogMemoryStats logs memory stats for `functionName`
func LogMemoryStats(log *Logger, functionName string) {
log.Debug(NewLogClosure(func() string {
log.Trace(NewLogClosure(func() string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

@michaelsutton michaelsutton merged commit 80879ca into kaspanet:dev Apr 3, 2022
@michaelsutton michaelsutton deleted the clean-debug-log branch April 3, 2022 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants