-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(iroh): Rename target for events (#2977)
## Description Turns out people will configure logs with `RUST_LOG=iroh=debug` and then the `events` target is completely lost. That's bad! This changes the events to be in the main crate target, so users don't have to separately enable them. It also changes the separators to use the `::`. The driver for this is compatible with the `EnvFliter` syntax, allowing you do do e.g. `RUST_LOG=iroh::events=debug` to enable just events. The main downside is that it is harder to enable events across different crates. But then we only use this in one crate so far, so perhaps that's not an issue yet. Another downside is that `iroh::events` could quite easily become a module name, in which case the targets would conflict. ## Breaking Changes - Events are emitted on different tracing targets: `iroh::events` instead of `events.net`. - Event names have changed to use `::` as separator, previously this was `.`. ## Notes & open questions Perhaps there is a better name than `events` that is less likely to conflict with a real module? Maybe we could use an illegal character? Experimenting with `iroh::-events::` as prefix does seem to work: it is accepted by the tracing and the EnvFilter is fine with it. ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented.
- Loading branch information
Showing
5 changed files
with
25 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters