Skip to content

Clean up logging #986

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
merged 5 commits into from
Jul 17, 2025
Merged

Clean up logging #986

merged 5 commits into from
Jul 17, 2025

Conversation

arner
Copy link
Contributor

@arner arner commented Jul 15, 2025

implements #981

@arner arner requested a review from adecaro July 15, 2025 09:04
Copy link
Contributor

@adecaro adecaro left a comment

Choose a reason for hiding this comment

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

Hi Arne, this looks good to me modulo the comments.
Let's take the change and use the context-based logs.
Thanks.

@@ -110,7 +110,7 @@ func (c *FinalityManager[V]) runStatusListener(ctx context.Context) {
c.logger.Debugf("check vault status for [%d] transactions", len(txIDs))
statuses, err := c.vault.Statuses(newCtx, txIDs...)
if err != nil {
c.logger.Errorf("error fetching statuses: %w", err)
c.logger.Errorf("error fetching statuses: %s", err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

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

please, Arne, while updating these logs, check also if a context.Context is available and in case, use the context logger. In this case, it would be ErrorfContext(ctx,...

This, in addition to writing a log, will also generate an event in the traces.
Please, make sure that the string printed is printable. Arguments might need to sanitized depending on the cases.

@@ -56,7 +56,7 @@ func (db *SimpleKeyDataStore) PutData(ctx context.Context, key string, data []by
Row(key, data).
OnConflictDoNothing().
Format()
logger.Debug(query, params)
logger.Debug(query, string(data))
Copy link
Contributor

Choose a reason for hiding this comment

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

in this case, we don't need the DebugfContext because an event in the trace will be added by the call to ExecContext later.

@adecaro adecaro self-assigned this Jul 15, 2025
@adecaro adecaro added cleanup Something needs some cleanup perf labels Jul 15, 2025
@adecaro adecaro linked an issue Jul 15, 2025 that may be closed by this pull request
Copy link
Contributor

@adecaro adecaro left a comment

Choose a reason for hiding this comment

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

LGTM

@adecaro adecaro merged commit d560d6b into main Jul 17, 2025
18 checks passed
@adecaro adecaro deleted the f-loglevels branch July 17, 2025 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Something needs some cleanup perf
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up logging
2 participants