Skip to content

Convert to slog as our logging library#688

Open
mkeeter wants to merge 4 commits into
masterfrom
mkeeter/the-slog-of-slogs
Open

Convert to slog as our logging library#688
mkeeter wants to merge 4 commits into
masterfrom
mkeeter/the-slog-of-slogs

Conversation

@mkeeter
Copy link
Copy Markdown
Contributor

@mkeeter mkeeter commented Jun 1, 2026

Per RFD 659, this converts us to using slog everywhere.

This PR is mostly mechanical! slog expects a logger object to be threaded through function calls. Here, we lazily construct it in the Cli, then grab it from the ExecutionContext. It's mostly passed as an argument, although in places where we build an XyzContext (e.g. HiffyContext), we clone a copy of the logger and store it locally to reduce boilerplate.

(cloning a slog::Logger is expected to be cheap)

Note that we still use env_logger for configuration in the humility-bin package, so that we can get verbose probe-rs logs (and maybe other libraries as well, but that's the loudest one).

This comment was marked as resolved.

@mkeeter
Copy link
Copy Markdown
Contributor Author

mkeeter commented Jun 1, 2026

One thing that I'd like opinions on: should we re-export the slog types from humility (perhaps via the now-deleted humility-log crate)? I could imagine exporting the various logging macros and Logger type, so that people using downstream crates wouldn't need a slog dependency of their own.

@mkeeter mkeeter force-pushed the mkeeter/the-slog-of-slogs branch from 167509f to 60a6c6b Compare June 1, 2026 19:10
@mkeeter
Copy link
Copy Markdown
Contributor Author

mkeeter commented Jun 1, 2026

One thing that I'd like opinions on: should we re-export the slog types from humility (perhaps via the now-deleted humility-log crate)? I could imagine exporting the various logging macros and Logger type, so that people using downstream crates wouldn't need a slog dependency of their own.

I've decided that I like this, but it's in a standalone commit at the top of the stack if anyone strongly disagrees.

@mkeeter mkeeter force-pushed the mkeeter/the-slog-of-slogs branch from 2b7fc12 to edea013 Compare June 2, 2026 18:25
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

Successfully merging this pull request may close these issues.

2 participants