Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
log: add ignored target prefixes to
LogTracer
(#215)
## Motivation People writing libraries using tracing may wish to expose regular `log` support via the `tracing/log` feature. At the same time, to get tracing support for crates using `log`, users may turn to `tracing_log::LogTracer`. Enabling both means logging events twice. ## Solution This branch adds a `Builder` to the `tracing_log::LogTracer` type, which allows configuring the `LogTracer` to ignore log records with targets beginning with a certain string. This can be used to ignore any crates which are emitting log records via the `tracing/log` feature. Ideally, we would provide a way to do this automatically, without requiring configuration, but that'll take some thinking. The ability to ignore certain sets of log records may be valuable even if we have an automatic method for crates to signal that they are using the `tracing/log` feature in the future. I've also moved the `LogTracer` and `TraceLogger` types in `tracing-log` out of `lib.rs` into their own modules, since the main lib file was getting a bit lengthy. Refs: #204 Signed-off-by: Eliza Weisman <eliza@buoyant.io>
- Loading branch information