SIGN IN SIGN UP

Associate logs from log_err with the calling crate (#13617)

Now, when you selectively enable logs from particular crates with
`RUST_LOG=call,worktree`, logs created via `log_err` calls in those
crates get correctly enabled. Previously, they were all attributed to
the `util` crate, because they used the normal logging macros, which
implicitly insert the current crate name.

This relies on the regularity of our directory naming. Rust's
`track_caller` feature allows you to obtain the file system path of the
caller, but not its rust module path, so I'm inferring the crate name
from the file system path (which I believe is always valid, in our
codebase).

Release Notes:

- N/A
M
Max Brunsfeld committed
97159bd88d6294128479cd1ee8b74de3fdad93d8
Parent: 0b57df5
Committed by GitHub <noreply@github.com> on 6/28/2024, 12:03:47 AM