oxidecomputer / falcon

Fast Assessment Laboratory for Computers On Networks
Mozilla Public License 2.0
6 stars 2 forks source link

Migrate from slog to tracing. #86

Open rcgoodfellow opened 3 months ago

rcgoodfellow commented 3 months ago

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.

https://github.com/oxidecomputer/falcon/blob/979dc8471964bd01bb7872fcb981c0bf46484b9b/lib/src/lib.rs#L252-L261

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

hawkw commented 3 months ago

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 commented 3 months ago

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?