tracing/tracing-subscriber
Arthur Gautier 1f0bdeec73 subscriber: fixup various compilation errors with no-default-features (#500)
* subscriber: compilation errors w/ nodefault + ansi

when compiling with -no-default-features --features "ansi", the
following compilation error would come up:
```
error[E0599]: no method named `with_env_filter` found for type `fmt::SubscriberBuilder` in the current scope
   --> tracing-subscriber/src/fmt/mod.rs:663:10
    |
146 | / pub struct SubscriberBuilder<
147 | |     N = format::DefaultFields,
148 | |     E = format::Format<format::Full>,
149 | |     F = LevelFilter,
...   |
153 | |     inner: LayerBuilder<Registry, N, E, W>,
154 | | }
    | |_- method `with_env_filter` not found for this
...
663 |           .with_env_filter(crate::EnvFilter::from_default_env())
    |            ^^^^^^^^^^^^^^^ method not found in `fmt::SubscriberBuilder`
```

* subscriber: compilation errors w/ nodefault + fmt

when compiling with -no-default-features --features "fmt", the following
compilation error would come up:
```
error[E0107]: wrong number of type arguments: expected 2, found 1
   --> tracing-subscriber/src/fmt/format/mod.rs:603:30
    |
603 | impl<'a, N> fmt::Display for FullCtx<'a, N>
    |                              ^^^^^^^^^^^^^^ expected 2 type arguments
```

* subscriber: compilation errors w/ nodefault + env-filter + fmt

when compiling with -no-default-features --features "env-filter fmt", the
following compilation error would come up:

```
error[E0277]: the trait bound `for<'lookup> <S as registry::LookupSpan<'_>>::Data: registry::LookupSpan<'lookup>` is not satisfied
   --> tracing-subscriber/src/fmt/format/mod.rs:304:44
    |
279 |     ) -> fmt::Result {
    |                     - help: consider further restricting the associated type: `where for<'lookup> <S as registry::LookupSpan<'_>>::Data: registry::LookupSpan<'lookup>`
...
304 |         write!(writer, "{} {}", fmt_level, fmt_ctx)?;
    |                                            ^^^^^^^ the trait `for<'lookup> registry::LookupSpan<'lookup>` is not implemented for `<S as registry::LookupSpan<'_>>::Data`
    |
    = note: required because of the requirements on the impl of `std::fmt::Display` for `fmt::format::FmtCtx<'_, S, N>`
    = note: required by `std::fmt::Display::fmt`

error[E0593]: closure is expected to take 1 argument, but it takes 2 arguments
   --> tracing-subscriber/src/fmt/format/mod.rs:530:18
    |
530 |         self.ctx.visit_spans(|_, span| {
    |                  ^^^^^^^^^^^ --------- takes 2 arguments
    |                  |
    |                  expected closure that takes 1 argument
```

Closes #494
2020-01-02 11:01:25 -08:00
..
2019-12-20 17:03:34 -08:00
2019-12-20 17:03:34 -08:00

tracing-subscriber

Utilities for implementing and composing tracing subscribers.

Crates.io Documentation Documentation (master) MIT licensed Build Status Discord chat maintenance status

Documentation | Chat

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tracing by you, shall be licensed as MIT, without any additional terms or conditions.