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

chore: remove tracing::info usage #578

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

dutterbutter
Copy link
Collaborator

@dutterbutter dutterbutter commented Feb 4, 2025

What πŸ’»

  • Turns off tracing::info! in favour of shell wrapper and macro usage. A simplified version of Foundry's shell wrapper.
  • Removes the timestamp for warn, error, debug, trace logs

Why βœ‹

Evidence πŸ“·

Include screenshots, screen recordings, or console output here demonstrating that your changes work as intended

@dutterbutter dutterbutter marked this pull request as ready for review February 4, 2025 02:05
@dutterbutter dutterbutter requested a review from a team as a code owner February 4, 2025 02:05
@dutterbutter dutterbutter marked this pull request as draft February 4, 2025 13:48
Cargo.toml Outdated Show resolved Hide resolved
spec-tests/src/patch.rs Outdated Show resolved Hide resolved
crates/common/src/shell.rs Outdated Show resolved Hide resolved
@dutterbutter dutterbutter marked this pull request as ready for review February 6, 2025 16:39
@dutterbutter
Copy link
Collaborator Author

dutterbutter commented Feb 6, 2025

@itegulov based on the proposal feedback, I turned off tracing::info by default, and adjusted some existing log levels. I did so quite arbitrarily so please feel free to suggest changing the level or removing completely. We are still logging out tx summary / console logs by default but intend to update in #577.

For revert / halts and logs in formatter.rs those will be subsequently updated in #571 and #577.

@dutterbutter dutterbutter added the needs review πŸ‘“ PR requires a review label Feb 7, 2025
Copy link
Member

@popzxc popzxc left a comment

Choose a reason for hiding this comment

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

Mostly LGTM


[dependencies]
anstream.workspace = true
anstyle.workspace = true
Copy link
Member

Choose a reason for hiding this comment

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

Nit: missing newline

Comment on lines +114 to +119
let prefix = if self.should_color() {
format!("{}Warning:{} ", WARN, Reset)
} else {
"Warning: ".to_string()
};
self.println_err(&format!("{}{}", prefix, msg))
Copy link
Member

Choose a reason for hiding this comment

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

Nit (here and in other places): extra allocations seem unjustified, we could easily just write to stdout/stderr.
Not that it's a performance concern, just feels not very clean. In that regard, I like foundry approach more.

@@ -55,7 +56,7 @@ impl InMemoryNode {
message
);

tracing::info!("{}", pretty_message.on_red());
sh_eprintln!("\n{}", pretty_message.on_red());
Copy link
Member

Choose a reason for hiding this comment

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

Here and in other places: why do we need \n to be inserted manually?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review πŸ‘“ PR requires a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor: Replace tracing::info! with stdout
3 participants