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

Small logging tweaks #4399

Merged
merged 2 commits into from
Mar 6, 2023
Merged

Small logging tweaks #4399

merged 2 commits into from
Mar 6, 2023

Conversation

lutter
Copy link
Collaborator

@lutter lutter commented Feb 26, 2023

No description provided.

Instead of logging lots of messages that are uninteresting on the happy
path, make sure that errors contain context that allow tracing back to
which operation failed.

Also add a little more information in the higher-level 'resolveing from
IPFS' messages
info!(logger, "Resolve data source"; "name" => &name, "source_address" => format_args!("{:?}", base64_url::encode(&source.owner.clone().unwrap_or_default())), "source_start_block" => source.start_block);

let mapping = mapping.resolve(resolver, logger).await?;
let mapping = mapping.resolve(resolver, logger).await.with_context(|| {
Copy link
Contributor

@mangas mangas Mar 3, 2023

Choose a reason for hiding this comment

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

Copy link
Contributor

@mangas mangas left a comment

Choose a reason for hiding this comment

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

if with_context is no longer an issue this LGTM

@lutter
Copy link
Collaborator Author

lutter commented Mar 6, 2023

if with_context is no longer an issue this LGTM

@leoyvens assures me that we just need to use debug formatting for anyhow errors and it'll be fine ;)

@lutter lutter merged commit a60d00d into master Mar 6, 2023
@lutter lutter deleted the lutter/logging branch March 6, 2023 18:55
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