-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Depends on #1247. Since `tracing-subscriber`'s `init` and `try_init` functions set the global default subscriber, we can use the subscriber's max-level hint as the max level for the log crate, as well. This should significantly improve performance for skipping `log` records that fall below the collector's max level, as they will not have to call the `LogTracer::enabled` method. This will prevent issues like bytecodealliance/wasmtime#2662 from occurring in the future. See also #1249. In order to implement this, I also changed the `FmtSubscriber`'s `try_init` to just use `util::SubscriberInitExt`'s `try_init` function, so that the same code isn't duplicated in multiple places. I also added `AsLog` and `AsTrace` conversions for `LevelFilter`s in the `tracing-log` crate. Signed-off-by: Eliza Weisman <eliza@buoyant.io>
- Loading branch information
Showing
5 changed files
with
51 additions
and
10 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