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

Shorten alloy types display output #6080

Closed
emhane opened this issue Jan 16, 2024 · 4 comments
Closed

Shorten alloy types display output #6080

emhane opened this issue Jan 16, 2024 · 4 comments
Labels
A-networking Related to networking in general A-observability Related to tracing, metrics, logs and other observability tools D-good-first-issue Nice and easy! A great choice to get started M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity

Comments

@emhane
Copy link
Member

emhane commented Jan 16, 2024

Describe the feature

make logs more friendly to read for the human eye.

it would be best to output the alternate display form of the alloy FixedBytes types. rn, tracing crate doesn't support this tokio-rs/tracing#1311, so we can't get away with simply trace!(peer_id=#peer_id). for now we need to allocate a string for this like trace!(peer_id=format!("{peer_id:#}").

to take into consideration here, is if any interop tests are using the current log output format, and if this then is a breaking change. (update: this is verified, it won't be a breaking change, no interop tests use hard coded log output as checkpoints)

here is how I have been setting alternate display flag in tracing for lists
tracing!(hashes=format!("[{}]", hashes.iter().fold(String::new(), |acc, &hash| acc + &format!("{hash:#},"))))

Additional context

No response

@emhane emhane added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Jan 16, 2024
@emhane emhane changed the title Shorten alloy types output Shorten alloy types display output Jan 16, 2024
@emhane emhane added D-good-first-issue Nice and easy! A great choice to get started and removed C-enhancement New feature or request labels Jan 16, 2024
@DaniPopes
Copy link
Member

DaniPopes commented Jan 16, 2024

Lists can be formatted more easily with Itertools::format:

format!("[{:#}]", list.iter().format(", "))

@emhane
Copy link
Member Author

emhane commented Jan 19, 2024

peer id is probably ok to shorten for all cases, but not tx hash. since block explorers require the whole hash in a search query, it's good to keep the whole hash even if the list is long.

@emhane emhane added A-networking Related to networking in general A-observability Related to tracing, metrics, logs and other observability tools labels Jan 21, 2024
@DaniPopes DaniPopes removed the S-needs-triage This issue needs to be labelled label Jan 22, 2024
Copy link
Contributor

github-actions bot commented Mar 4, 2024

This issue is stale because it has been open for 21 days with no activity.

@github-actions github-actions bot added the S-stale This issue/PR is stale and will close with no further activity label Mar 4, 2024
@emhane emhane added M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity and removed S-stale This issue/PR is stale and will close with no further activity labels Mar 10, 2024
@mattsse
Copy link
Collaborator

mattsse commented Aug 20, 2024

closing because unclear what the todos here are

if there's anything actionable here, please open a new good first issue for this

@mattsse mattsse closed this as completed Aug 20, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-networking Related to networking in general A-observability Related to tracing, metrics, logs and other observability tools D-good-first-issue Nice and easy! A great choice to get started M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity
Projects
Archived in project
Development

No branches or pull requests

3 participants