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

Migrate from slog to tracing. #86

Open
rcgoodfellow opened this issue Aug 22, 2024 · 2 comments
Open

Migrate from slog to tracing. #86

rcgoodfellow opened this issue Aug 22, 2024 · 2 comments

Comments

@rcgoodfellow
Copy link
Collaborator

Slog itself recommends using tracing, so let's use tracing.

Also: slog env_looger is a bit derpy to set up with defaults that provide useful logging information for falcon CLI applications. In particular, the need to set the environment variable RUST_LOG with std::env::set_var is unsafe from multi-threaded code.

falcon/lib/src/lib.rs

Lines 252 to 261 in 979dc84

match std::env::var("RUST_LOG") {
Ok(s) => {
if s.is_empty() {
std::env::set_var("RUST_LOG", "info");
}
}
_ => {
std::env::set_var("RUST_LOG", "info");
}
}

Hopefully, we can find a better path forward with tracing for user-configurable log levels with a useful default.

@hawkw
Copy link
Member

hawkw commented Aug 22, 2024

Let me know if you could use a hand with this one --- always happy to answer tracing-related questions (or go fix anything that's broken)!

@davepacheco
Copy link

FWIW, there's a whole RFD about this though it seems to have stalled: https://rfd.shared.oxide.computer/rfd/489

I don't think this by itself is a reason to switch? Programs construct the slog loggers and can specify whatever logger they want, and they can honor whatever environment variables they want in determining that, can't they?

@rcgoodfellow rcgoodfellow mentioned this issue Sep 3, 2024
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

No branches or pull requests

3 participants