-
Notifications
You must be signed in to change notification settings - Fork 31
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
Refactor redirect_stderr_to_file to solana-logger #64
Conversation
Looks good, this code was stuck in validator crate but can be useful to every CLI tool that uses solana_logger crate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since solana-logger already transitively depends on libc, the new signal-hook dependency adds very little to the build time, around 0.1s on my machine, so it looks good to me!
Just some tiny comments.
logger/Cargo.toml
Outdated
@@ -2,7 +2,7 @@ | |||
name = "solana-logger" | |||
description = "Solana Logger" | |||
documentation = "https://docs.rs/solana-logger" | |||
version = "2.2.1" | |||
version = "2.2.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't do the version bump here, the release job will take care of that automatically as mentioned at https://github.com/anza-xyz/solana-sdk?tab=readme-ov-file#publishing-a-crate-from-this-repository
logger/src/lib.rs
Outdated
#[cfg(unix)] | ||
#[cfg(not(target_arch = "wasm32"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: these can get condensed into one
#[cfg(unix)] | |
#[cfg(not(target_arch = "wasm32"))] | |
#[cfg(all(unix, not(target_arch = "wasm32")))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me!
redirect_stderr_to_file can be used multiple applications. I found the need to use it in vortexor. Moving this from validator to solana-logger.
Refactored from https://github.com/anza-xyz/agave/blob/master/validator/src/lib.rs#L39 which will be removed once this change made to the SDK