10 Commits

Author SHA1 Message Date
Julian Tescher
ee1e5308fb Fix small typos (#405) 2019-10-24 15:12:52 -07:00
Eliza Weisman
fec24bfcf1
subscriber: rename Filter to EnvFilter (#339)
This branch renames `Filter` to `EnvFilter` and deprecates the previous
name, as suggested in https://github.com/tokio-rs/tracing/pull/336#pullrequestreview-286356811.
This should make the difference between an `EnvFilter` and a
`LevelFilter` clearer.
The `filter` feature has also been deprecated in favor of `env-filter`.

Co-Authored-By: Benjamin Saunders <ben.e.saunders@gmail.com>
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-09-12 12:44:40 -07:00
Eliza Weisman
b385da6b02
subscriber: better default filtering (#336)
## Feature Request

### Crates

- `tracing-subscriber`

### Motivation

Currently, the `tracing-subscriber` `FmtSubscriber::default`
implementation defaults to no filtering. This means that all
instrumentation, including extremely verbose `trace`-level diagnostics
from crates like `tokio` are enabled by default.

This is because the subscriber itself does not implement filtering, in
order to allow it to be composed with filters implemented by `Layer`s.
However, defaulting to no filtering at all is definitely a surprising
behavior. I didn't want to conditionally return a different type based
on whether or not filtering was enabled by the `filter` feature flag,
but this is probably not worth the confusion introduced by this
behavior. We should make this more intuitive.

## Solution

This branch changes `tracing-subscriber` to default to enabling
the `INFO` level and above. If the `filter` feature flag is enabled,
users may opt-in to `env_logger`-style filtering. Additionally, 
regardless of feature flags, a new `with_max_level` method is
added to the `FmtSubscriber` builder, which takes a `Level` or
`LevelFilter`. `LevelFilter` now implements `Layer` by enabling
any spans and events that are less than or equal to that `Level`.

Fixes: #331 
Fixes: #332

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-09-10 16:04:55 -07:00
Eliza Weisman
2520f97964
fmt, subscriber: move fmt into subscriber (#311)
## Motivation

As discussed in #308, there are a large number of crates in this
repository, which can be confusing for users and can increase the
maintainance burden for maintainers. Also, the `tracing-fmt` and
`tracing-subscriber` crates both contain filtering implementations with
similar behaviour and APIs, but `tracing-subscriber`'s filter module
offers more advanced features (filtering on field values), and is usable
with any subscriber implementation. Two separate filter implementations
also has the potential to be confusing for users. 

## Solution

This branch moves most of the code from `tracing-fmt` into a module in
`tracing-subscriber`, and changes the `tracing-fmt` builder APIs to use
the `Filter` type in `tracing-subscriber`. The `tracing-subscriber/fmt`
feature flag can be used to disable the formatting subscriber when it is
not used.

The `tracing-fmt` crate has been updated to re-export the APIs from
`tracing-subscriber`, and marked as deprecated. Once we've published a
new version of `tracing-subscriber` with the format APIs, we can publish
a final release of `tracing-fmt` that will update the documentation &
mark all APIs as deprecated, so that users know to move to the
`tracing-subscriber` crate.

Refs: #308

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-09-02 08:53:58 -07:00
Eliza Weisman
9161b5f2aa
examples: track upstream (#307)
Apparently `TcpListener::bind` is async now.

This fixes CI.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-08-30 11:06:12 -07:00
Bhargav Voleti
2100edca3c Address review comments 2019-08-25 13:47:22 -07:00
Bhargav Voleti
a3a789521c Async await does not require a feature gate anymore! 2019-08-25 13:47:22 -07:00
Bhargav Voleti
8698321a2f Review comments 2019-08-25 13:47:22 -07:00
Bhargav Voleti
64a7ebc2f7 Port spawny_thing 2019-08-25 13:47:22 -07:00
Bhargav Voleti
cacbe06138 Add proxy server example
* Plus the echo example from tokio for a concurrent echo server
2019-08-25 13:47:22 -07:00