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

Logs errors as Debug and not Display #2161

Merged
merged 2 commits into from
Mar 22, 2022
Merged

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Mar 22, 2022

All the logs that look a bit "system-y" (which are all the debug and trace logs) now show errors through the Debug trait rather than Display

This fits the vibe of the log line more, and also provides additional information.

The Display trait is still used for warning and error logs that the user is expected to react to.

Copy link
Contributor

@mergify mergify bot left a comment

Choose a reason for hiding this comment

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

Automatically approving tomaka's pull requests. This auto-approval will be removed once more maintainers are active.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 22, 2022

twiggy diff report

Difference in .wasm size before and after this pull request.


 Delta Bytes │ Item
─────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       +1136 ┊ data[0]
        -641 ┊ <smoldot::network::service::ProtocolError as core::fmt::Display>::fmt::hbf38f663cec40cb2
        +415 ┊ <smoldot::chain::blocks_tree::finality::FinalityVerifyError as core::fmt::Debug>::fmt::h3ad72931f054c9cd
        +398 ┊ <smoldot::verify::babe::VerifyError as core::fmt::Debug>::fmt::hdfa3018885e50bc5
        +379 ┊ <smoldot::libp2p::connection::established::substream::InboundError as core::fmt::Debug>::fmt::hafcfb0f5ec536cd7
        +360 ┊ <smoldot::network::service::BlocksRequestError as core::fmt::Debug>::fmt::hc6ca1b582fe05325
        +353 ┊ <smoldot::network::service::ProtocolError as core::fmt::Debug>::fmt::h9703abd7eada4947
        +350 ┊ <smoldot_light_base::sync_service::parachain::ParaheadError as core::fmt::Debug>::fmt::h6ed7cd4677f3a267
        +263 ┊ <smoldot::libp2p::connection::established::substream::NotificationsOutErr as core::fmt::Debug>::fmt::hf434665d9d94713c
        -260 ┊ <smoldot::network::service::NotificationsOutErr as core::fmt::Display>::fmt::he7e64f7f41acaadc
        +246 ┊ <smoldot::finality::justification::verify::Error as core::fmt::Debug>::fmt::h10d40555709ae8a2
        +245 ┊ <smoldot::chain::blocks_tree::finality::JustificationVerifyError as core::fmt::Debug>::fmt::h3523b399ed9373a0
        +239 ┊ <smoldot::verify::header_only::Error as core::fmt::Debug>::fmt::hd988eb1ca0a8cce6
        +231 ┊ <smoldot::network::service::BlocksRequestResponseEntryError as core::fmt::Debug>::fmt::h5fc53932555ca7f2
        +230 ┊ <smoldot::network::protocol::block_request::DecodeBlockRequestError as core::fmt::Debug>::fmt::h96227c75fdb87289
        +221 ┊ <smoldot_light_base::sync_service::parachain::ParaheadError as core::fmt::Display>::fmt::h3ec676f857e9048b
        -221 ┊ <smoldot_light_base::sync_service::parachain::ParaheadError as core::fmt::Display>::fmt::h6ed7cd4677f3a267
        +220 ┊ <smoldot::network::service::NotificationsOutErr as core::fmt::Debug>::fmt::h9e086aac503701cc
        +182 ┊ <smoldot::network::protocol::block_request::DecodeBlockResponseError as core::fmt::Debug>::fmt::h70855318bd38615e
        +180 ┊ <smoldot::verify::aura::VerifyError as core::fmt::Debug>::fmt::ha2390ef2da97d79d
       +1301 ┊ ... and 47 more.
      +11415 ┊ Σ [67 Total Rows]

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Mar 22, 2022
@mergify mergify bot merged commit 53e0ea4 into paritytech:main Mar 22, 2022
@tomaka tomaka deleted the errors-debug branch March 22, 2022 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge pull request as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants