52 Commits

Author SHA1 Message Date
Eliza Weisman
290eff2e4d
subscriber: prepare to release v0.3.15 (#2237)
# 0.3.15 (Jul 20, 2022)

This release fixes a bug where the `reload` layer would fail to pass
through  `max_level_hint` to the underlying layer, potentially breaking
filtering.

### Fixed

- **reload**: pass through `max_level_hint` to the inner `Layer`
  ([#2204])

Thanks to @guswynn for contributing to this release!

[#2204]: https://github.com/tokio-rs/tracing/pull/2204
2022-07-20 12:36:20 -07:00
Eliza Weisman
9638587480
subscriber: prepare to release v0.3.14 (#2201)
# 0.3.14 (Jul 1, 2022)

This release fixes multiple filtering bugs in the `Layer`
implementations for `Option<impl Layer>` and `Vec<impl Layer>`.

### Fixed

- **layer**: `Layer::event_enabled` implementation for `Option<impl
  Layer<S>>` returning `false` when the `Option` is `None`, disabling
  all events globally ([#2193])
- **layer**: `Layer::max_level_hint` implementation for `Option<impl
  Layer<S>>` incorrectly disabling max level filtering when the option
  is `None` ([#2195])
- **layer**: `Layer::max_level_hint` implementation for `Vec<impl
  Layer<S>>` returning `LevelFilter::ERROR` rather than
  `LevelFilter::OFF` when the `Vec` is empty ([#2195])

Thanks to @CAD97 and @guswynn for contributing to this release!

[#2193]: https://github.com/tokio-rs/tracing/pull/2193
[#2195]: https://github.com/tokio-rs/tracing/pull/2195
2022-07-01 17:37:10 +00:00
Eliza Weisman
2fdbaaa1e8
subscriber: prepare to release v0.3.13 (#2192)
# 0.3.13 (Jun 30, 2022)

This release of `tracing-subscriber` fixes a compilation failure due to
an incorrect `tracing-core` dependency that was introduced in v0.3.12.

### Changed

- **tracing_core**: Updated minimum dependency version to 0.1.28 (#2190)
2022-06-30 13:33:38 -07:00
Eliza Weisman
d86d2a4b7e
subscriber: prepare to release v0.3.12 (#2187)
# 0.3.12 (Jun 29, 2022)

This release of `tracing-subscriber` adds a new `Layer::event_enabled`
method, which allows `Layer`s to filter events *after* their field
values are recorded; a `Filter` implementation for `reload::Layer`, to
make using `reload` with per-layer filtering more ergonomic, and
additional inherent method downcasting APIs for the `Layered` type. In
addition, it includes dependency updates, and minor fixes for
documentation and feature flagging.

### Added

- **layer**: `Layer::event_enabled` method, which can be implemented to
  filter events based on their field values (#2008)
- **reload**: `Filter` implementation for `reload::Layer` (#2159)
- **layer**: `Layered::downcast_ref` and `Layered::is` inherent methods
  (#2160)

### Changed

- **parking_lot**: Updated dependency on `parking_lot` to 0.13.0
  (#2143)
- Replaced `lazy_static` dependency with `once_cell` (#2147)

### Fixed

- Don't enable `tracing-core` features by default (#2107)
- Several documentation link and typo fixes (#2064, #2068, #2077,
  #2161, #1088)

Thanks to @ben0x539, @jamesmunns, @georgemp, @james7132, @jswrenn,
@CAD97, and @guswynn for contributing to this release!
2022-06-29 12:41:08 -07:00
Eliza Weisman
b9da5441ea
subscriber: prepare to release v0.3.11 (#2062)
# 0.3.11 (Apr 9, 2022)

This is a bugfix release for the `Filter` implementation for `EnvFilter` added
in [v0.3.10].

### Fixed

- **env-filter**: Added missing `Filter::on_record` callback to `EnvFilter`'s
  `Filter` impl ([#2058])
- **env-filter**: Fixed method resolution issues when calling `EnvFilter`
  methods with both the `Filter` and `Layer` traits in scope ([#2057])
- **env-filter**: Fixed `EnvFilter::builder().parse()` and other parsing methods
  returning an error when parsing an empty string ([#2052])

Thanks to new contributor @Ma124 for contributing to this release!

[v0.3.10]: https://github.com/tokio-rs/tracing/releases/tag/tracing-subscriber-0.3.10
[#2058]: https://github.com/tokio-rs/tracing/pull/2058
[#2057]: https://github.com/tokio-rs/tracing/pull/2057
[#2052]: https://github.com/tokio-rs/tracing/pull/2052
2022-04-09 14:36:25 -07:00
Eliza Weisman
42888dc5c9
subscriber: prepare to release v0.3.10 (#2041)
# 0.3.10 (Apr 1, 2022)

This release adds several new features, including a `Filter`
implementation and new builder API for `EnvFilter`, support for using a
`Vec<L> where L: Layer` as a `Layer`, and a number of smaller API
improvements to make working with dynamic and reloadable layers easier.

### Added

- **registry**: Implement `Filter` for `EnvFilter`, allowing it to be
  used with per-layer filtering ([#1983])
- **registry**: `Filter::on_new_span`, `Filter::on_enter`,
  `Filter::on_exit`, `Filter::on_close` and `Filter::on_record`
  callbacks to allow `Filter`s to track span states internally ([#1973],
  [#2017], [#2031])
- **registry**: `Filtered::filter` and `Filtered::filter_mut` accessors
  ([#1959])
- **registry**: `Filtered::inner` and `Filtered::inner_mut` accessors to
  borrow the wrapped `Layer` ([#2034])
- **layer**: Implement `Layer` for `Vec<L: Layer>`, to allow composing
  together a dynamically sized list of `Layer`s ([#2027])
- **layer**: `Layer::boxed` method to make type-erasing `Layer`s easier
  ([#2026])
- **fmt**: `fmt::Layer::writer` and `fmt::Layer::writer_mut` accessors
  ([#2034])
- **fmt**: `fmt::Layer::set_ansi` method to allow changing the ANSI
  formatting configuration at runtime ([#2034])
- **env-filter**: `EnvFilter::builder` to configure a new `EnvFilter`
  prior to parsing it ([#2035])
- Several documentation fixes and improvements ([#1972], [#1971],
  [#2023], [#2023])

### Fixed

- **fmt**: `fmt::Layer`'s auto traits no longer depend on the
  `Subscriber` type parameter's auto traits ([#2025])
- **env-filter**: Fixed missing help text when the `ansi` feature is
  disabled ([#2029])

Thanks to new contributors @TimoFreiberg and @wagenet, as well as @CAD97
for contributing to this release!

[#1983]: https://github.com/tokio-rs/tracing/pull/1983
[#1973]: https://github.com/tokio-rs/tracing/pull/1973
[#2017]: https://github.com/tokio-rs/tracing/pull/2017
[#2031]: https://github.com/tokio-rs/tracing/pull/2031
[#1959]: https://github.com/tokio-rs/tracing/pull/1959
[#2034]: https://github.com/tokio-rs/tracing/pull/2034
[#2027]: https://github.com/tokio-rs/tracing/pull/2027
[#2026]: https://github.com/tokio-rs/tracing/pull/2026
[#2035]: https://github.com/tokio-rs/tracing/pull/2035
[#1972]: https://github.com/tokio-rs/tracing/pull/1972
[#1971]: https://github.com/tokio-rs/tracing/pull/1971
[#2023]: https://github.com/tokio-rs/tracing/pull/2023
[#2025]: https://github.com/tokio-rs/tracing/pull/2025
[#2029]: https://github.com/tokio-rs/tracing/pull/2029
2022-04-01 10:51:20 -07:00
Eliza Weisman
2974ae973b
subscriber: prepare to release v0.3.9 (#1938)
# 0.3.9 (Feb 17, 2022)

This release updates the minimum supported Rust version (MSRV) to
1.49.0, and updates the (optional) dependency on `parking_lot` to v0.12.

### Changed

- Updated minimum supported Rust version (MSRV) to 1.49.0 ([#1913])
- `parking_lot`: updated to v0.12 ([008339d])

### Added

- **fmt**: Documentation improvements ([#1926], [#1927])

[#1913]: https://github.com/tokio-rs/tracing/pull/1913
[#1926]: https://github.com/tokio-rs/tracing/pull/1926
[#1927]: https://github.com/tokio-rs/tracing/pull/1927
[008339d]: 008339d1e8
2022-02-17 16:16:21 -08:00
Eliza Weisman
32225276a9 chore: update MSRVs from 1.42 to 1.49 (#1913)
This updates all crates' MSRVs to 1.49 if they were not already greater
than that (`tracing-appender` is at 1.53). Rust 1.49+ is required to
update `parking_lot` to v0.12 (see #1878). Also, `futures-task` (which I
believe is only needed as a transitive dep) now needs 1.45+, so this
also fixes our CI build.

Because `tracing-opentelemetry` previously required 1.46.0, it had a
separate CI MSRV job. Since 1.49.0 is greater than 1.46.0, the separate
check for `tracing-opentelemetry` is no longer needed.

In the process, I removed deprecated uses of
`core::atomic::spin_loop_hint`, which is replaced with
`core::hint::spin_loop` in 1.49.
2022-02-07 15:39:26 -08:00
Eliza Weisman
b37220c651
subscriber: prepare to release v0.3.8 (#1905)
# 0.3.8 (Feb 4, 2022)

This release adds *experimental* support for recording structured field
values using the [`valuable`] crate to the `format::Json` formatter. In
particular, user-defined types which are recorded using their
[`valuable::Valuable`] implementations will be serialized as JSON
objects, rather than using their `fmt::Debug` representation. See [this
blog post][post] for details on `valuable`.

Note that `valuable` support currently requires `--cfg
tracing_unstable`. See the documentation for details.

Additionally, this release includes a number of other smaller API
improvements.

### Added

- **json**: Experimental support for recording [`valuable`] values as
  structured JSON ([#1862], [#1901])
- **filter**: `Targets::would_enable` method for testing if a `Targets`
  filter would enable a given target ([#1903])
- **fmt**: `map_event_format`, `map_fmt_fields`, and `map_writer`
  methods to `fmt::Layer` and `fmt::SubscriberBuilder` ([#1871])

### Changed

- `tracing-core`: updated to [0.1.22][core-0.1.22]

### Fixed

- Set `smallvec` minimal version to 1.2.0, to fix compilation errors
  with `-Z minimal-versions` ([#1890])
- Minor documentation fixes ([#1902], [#1893])

Thanks to @guswynn, @glts, and @lilyball for contributing to this
release!

[`valuable`]: https://crates.io/crates/valuable
[`valuable::Valuable`]: https://docs.rs/valuable/latest/valuable/trait.Valuable.html
[post]: https://tokio.rs/blog/2021-05-valuable
[core-0.1.22]: https://github.com/tokio-rs/tracing/releases/tag/tracing-core-0.1.22
[#1862]: https://github.com/tokio-rs/tracing/pull/1862
[#1901]: https://github.com/tokio-rs/tracing/pull/1901
[#1903]: https://github.com/tokio-rs/tracing/pull/1903
[#1871]: https://github.com/tokio-rs/tracing/pull/1871
[#1890]: https://github.com/tokio-rs/tracing/pull/1890
[#1902]: https://github.com/tokio-rs/tracing/pull/1902
[#1893]: https://github.com/tokio-rs/tracing/pull/1893
2022-02-04 20:17:44 +00:00
Eliza Weisman
24ee184dc7
subscriber: prepare to release v0.3.7 (#1860)
# 0.3.7 (Jan 25, 2022)

This release adds combinators for combining filters.

Additionally, this release also updates the `thread-local` crate to
v1.1.4, fixing warnings for the security advisory [RUSTSEC-2022-0006].
Note that previous versions of `tracing-subscriber` did not use any of
the `thread-local` crate's APIs effected by the vulnerability. However,
updating the version fixes warnings emitted by `cargo audit` and similar
tools.

### Added

- **filter**: Added combinators for combining filters ([#1578])

### Fixed

- **registry**: Updated `thread-local` to v1.1.4 ([#1858])

Thanks to new contributor @matze for contributing to this release!

[RUSTSEC-2022-0006]: https://rustsec.org/advisories/RUSTSEC-2022-0006
[#1578]: https://github.com/tokio-rs/tracing/pull/1578
[#1858]: https://github.com/tokio-rs/tracing/pull/1858
2022-01-25 15:19:43 -05:00
Eliza Weisman
f835405993
subscriber: prepare to release 0.3.6 (#1839)
# 0.3.6 (Jan 14, 2022)

This release adds configuration options to `tracing_subscriber::fmt` to
log source code locations for events.
### Added

- **fmt**: Added `with_file` and `with_line_number` configuration
  methods to `fmt::Format`, `fmt::SubscriberBuilder`, and `fmt::Layer`
  ([#1773])

### Fixed

- **fmt**: Removed incorrect leading comma from span fields with the
  `Pretty` formatter ([#1833])

### Deprecated

- **fmt**: Deprecated `Pretty::with_source_location`, as it can now be
  replaced by the more general `Format`, `SubscriberBuilder`, and
  `Layer` methods ([#1773])

Thanks to new contributor @renecouto for contributing to this release!

[#1773]: https://github.com/tokio-rs/tracing/pull/1773
[#1833]: https://github.com/tokio-rs/tracing/pull/1833
2022-01-14 13:15:45 -08:00
Eliza Weisman
06914c12e5
subscriber: prepare to release 0.3.5 (#1810)
# 0.3.5 (Dec 29, 2021)

This release re-enables `RUST_LOG` filtering in
`tracing_subscriber::fmt`'s default initialization methods, and adds an
`OffsetLocalTime` formatter for using local timestamps with the `time`
crate.

### Added

- **fmt**: Added `OffsetLocalTime` formatter to `fmt::time` for
  formatting local timestamps with a fixed offset ([#1772])

### Fixed

- **fmt**: Added a `Targets` filter to `fmt::init()` and
  `fmt::try_init()` when the "env-filter" feature is disabled, so that
  `RUST_LOG` is still honored ([#1781])

Thanks to @marienz and @ishitatsuyuki for contributing to this release!

[#1772]: https://github.com/tokio-rs/tracing/pull/1772
[#1781]: https://github.com/tokio-rs/tracing/pull/1781
2021-12-29 16:22:05 -08:00
Eliza Weisman
18f358ce26
subscriber: prepare to release v0.3.4 (#1800)
# 0.3.4 (Dec 23, 2021)

This release contains bugfixes for the `fmt` module, as well as documentation
improvements.

### Fixed

- **fmt**: Fixed `fmt` not emitting log lines when timestamp formatting fails
  ([#1689])
- **fmt**: Fixed double space before thread IDs with `Pretty` formatter
  ([#1778])
- Several documentation improvements ([#1608], [#1699], [#1701])

[#1689]: https://github.com/tokio-rs/tracing/pull/1689
[#1778]: https://github.com/tokio-rs/tracing/pull/1778
[#1608]: https://github.com/tokio-rs/tracing/pull/1608
[#1699]: https://github.com/tokio-rs/tracing/pull/1699
[#1701]: https://github.com/tokio-rs/tracing/pull/1701

Thanks to new contributors @Swatinem and @rukai for contributing to this
release!
2021-12-23 15:16:49 -08:00
Eliza Weisman
2f809784ba
subscriber: prepare to release v0.3.1 (#1687)
# 0.3.1 (Oct 25, 2021)

This release fixes a few issues related to feature flagging.

### Fixed

- **time**: Compilation error when enabling the "time" feature flag
  without also enabling the "local-time" feature flag ([#1685])
- **registry**: Unused method warnings when the "std" feature is enabled
  but the "registry" feature is disabled ([#1686])

[#1685]: https://github.com/tokio-rs/tracing/pull/1685
[#1686]: https://github.com/tokio-rs/tracing/pull/1686
2021-10-25 10:03:59 -07:00
Eliza Weisman
4e56741c65
subscriber: prepare to release v0.3.0 (#1677)
# 0.3.0 (Oct 22, 2021)

This is a breaking release of `tracing-subscriber`. The primary breaking
change in this release is the removal of the dependency on the [`chrono`
crate], due to [RUSTSEC-2020-0159]. To replace `chrono`, support is
added for formatting timestamps using the [`time` crate] instead.

In addition, this release includes a number of other breaking API
changes, such as adding (limited) support for `#![no_std]` targets,
removing previously deprecated APIs, and more.

### Breaking Changes

- Removed APIs deprecated in the v0.2.x release series.
- Renamed `Layer::new_span` to `Layer::on_new_span` ([#1674])
- Removed `Layer` impl for `Arc<L: Layer<S>>` and `Arc<dyn Layer<S> +
  ...>` ([#1649])
- Replaced the [`chrono` crate] with the [`time` crate] for timestamp
  formatting, to resolve [RUSTSEC-2020-0159] ([#1646])
- Removed `json` and `env-filter` from default features. They must now
  be enabled explictly ([#1647])
- Changed `FormatEvent::format_event` and `FormatFields::format_fields`
  trait methods to take a `Writer` type, rather than a `&mut dyn
  fmt::Write` trait object ([#1661])
- Changed the signature of the `MakeWriter` trait by adding a lifetime
  parameter ([#781])
  ### Changed

- **layer**: Renamed `Layer::new_span` to `Layer::on_new_span` ([#1674])
- **fmt**: Changed `FormatEvent::format_event` and
  `FormatFields::format_fields` trait methods to take a `Writer` type,
  rather than a `&mut dyn fmt::Write` trait object ([#1661])
- **json**, **env-filter**: `json` and `env-filter` feature flags are no
  longer enabled by default ([#1647])
  ### Removed

- Removed deprecated `CurrentSpan` type ([#1320])
- **registry**: Removed deprecated `SpanRef::parents` iterator, replaced
  by `SpanRef::scope` in [#1431] ([#1648)])
- **layer**: Removed deprecated `Context::scope` iterator, replaced by
  `Context::span_scope` and `Context::event_scope` in [#1431] and
  [#1434] ([#1648)])
- **layer**: Removed `Layer` impl for `Arc<L: Layer<S>>` and `Arc<dyn
  Layer<S> + ...>`. These interfere with per-layer filtering. ([#1649])
- **fmt**: Removed deprecated `LayerBuilder` type ([#1673])
- **fmt**: Removed `fmt::Layer::on_event` (renamed to
  `fmt::Layer::fmt_event`) ([#1673])
- **fmt**, **chrono**: Removed the `chrono` feature flag and APIs for
  using the [`chrono` crate] for timestamp formatting ([#1646])
  ### Added

- **fmt**, **time**: `LocalTime` and `UtcTime` types for formatting
  timestamps using the [`time` crate] ([#1646])
- **fmt**: Added a lifetime parameter to the `MakeWriter` trait,
  allowing it to return a borrowed writer. This enables implementations
  of `MakeWriter` for types such as `Mutex<T: io::Write>` and
  `std::fs::File`. ([#781])
- **env-filter**: Documentation improvements ([#1637])
- Support for some APIs on `#![no_std]` targets, by disabling the `std`
  feature flag ([#1660])

Thanks to @Folyd and @nmathewson for contributing to this release!

[#1320]: https://github.com/tokio-rs/tracing/pull/1320
[#1673]: https://github.com/tokio-rs/tracing/pull/1673
[#1674]: https://github.com/tokio-rs/tracing/pull/1674
[#1646]: https://github.com/tokio-rs/tracing/pull/1646
[#1647]: https://github.com/tokio-rs/tracing/pull/1647
[#1648]: https://github.com/tokio-rs/tracing/pull/1648
[#1649]: https://github.com/tokio-rs/tracing/pull/1649
[#1660]: https://github.com/tokio-rs/tracing/pull/1660
[#1661]: https://github.com/tokio-rs/tracing/pull/1661
[#1431]: https://github.com/tokio-rs/tracing/pull/1431
[#1434]: https://github.com/tokio-rs/tracing/pull/1434
[#781]: https://github.com/tokio-rs/tracing/pull/781

[`chrono` crate]: https://crates.io/crates/chrono
[`time` crate]: https://crates.io/crates/time
[RUSTSEC-2020-0159]: https://rustsec.org/advisories/RUSTSEC-2020-0159.html

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2021-10-22 16:01:35 -07:00
Eliza Weisman
6692aaf738
subscriber: prepare to release 0.2.25 (#1622)
# 0.2.25 (October 5, 2021)

This release fixes an issue where a `Layer` implementation's custom
`downcast_raw` implementation was lost when wrapping that layer with a
per-layer filter.

### Fixed

- **registry**: Forward `Filtered::downcast_raw` to wrapped `Layer`
  ([#1619])

### Added

- Documentation improvements ([#1596], [#1601])

Thanks to @bryanburgers for contributing to this release!

[#1619]: https://github.com/tokio-rs/tracing/pull/1619
[#1601]: https://github.com/tokio-rs/tracing/pull/1601
[#1596]: https://github.com/tokio-rs/tracing/pull/1596
2021-10-05 15:39:32 -07:00
Eliza Weisman
9ac27fbc92
subscriber: prepare to release 0.2.24 (#1582)
# 0.2.24 (September 19, 2021)

This release contains a number of bug fixes, including a fix for
`tracing-subscriber` failing to compile on the minimum supported Rust
version of 1.42.0. It also adds `IntoIterator` implementations for the
`Targets` type.

### Fixed

- Fixed compilation on Rust 1.42.0 ([#1580], [#1581])
- **registry**: Ensure per-layer filter `enabled` state is cleared when
  a global filter short-circuits filter evaluation ([#1575])
- **layer**: Fixed `Layer::on_layer` not being called for `Box`ed
  `Layer`s, which broke  per-layer filtering ([#1576])

### Added

- **filter**: Added `Targets::iter`, returning an iterator over the set
  of target-level pairs enabled by a `Targets` filter ([#1574])
- **filter**:  Added `IntoIterator` implementations for `Targets` and
  `&Targets` ([#1574])

Thanks to new contributor @connec for contributing to this release!

[#1580]: https://github.com/tokio-rs/tracing/pull/1580
[#1581]: https://github.com/tokio-rs/tracing/pull/1581
[#1575]: https://github.com/tokio-rs/tracing/pull/1575
[#1576]: https://github.com/tokio-rs/tracing/pull/1576
[#1574]: https://github.com/tokio-rs/tracing/pull/1574
2021-09-19 17:32:01 -07:00
Eliza Weisman
a792aa80a3
subscriber: prepare to release v0.2.23 (#1573)
# 0.2.23 (September 16, 2021)

This release fixes a few bugs in the per-layer filtering API added in
v0.2.21.

### Fixed

- **env-filter**: Fixed excessive `EnvFilter` memory use ([#1568])
- **filter**: Fixed a panic that may occur in debug mode when using
  per-layer filters together with global filters ([#1569])
- Fixed incorrect documentation formatting ([#1572])

[#1568]: https://github.com/tokio-rs/tracing/pull/1568
[#1569]: https://github.com/tokio-rs/tracing/pull/1569
[#1572]: https://github.com/tokio-rs/tracing/pull/1572
2021-09-16 10:50:01 -07:00
Eliza Weisman
dd49b99016
subscriber: prepare to release 0.2.18 (#1384)
# 0.2.18 (April 30, 2021)

### Deprecated

- Deprecated the `CurrentSpan` type, which is inefficient and largely
  superseded by the `registry` API ([#1321])

### Fixed

- **json**: Invalid JSON emitted for events in spans with no fields
  ([#1333])
- **json**: Missing span data for synthesized new span, exit, and close
  events ([#1334])
- **fmt**: Extra space before log lines when timestamps are disabled
  ([#1355])

### Added

- **env-filter**: Support for filters on spans whose names contain any
  characters other than `{` and `]` ([#1368])

Thanks to @Folyd, and new contributors @akinnane and @aym-v for
contributing to  this release!

[#1321]: https://github.com/tokio-rs/tracing/pull/1321
[#1333]: https://github.com/tokio-rs/tracing/pull/1333
[#1334]: https://github.com/tokio-rs/tracing/pull/1334
[#1355]: https://github.com/tokio-rs/tracing/pull/1355
[#1368]: https://github.com/tokio-rs/tracing/pull/1368
2021-05-01 09:25:15 -07:00
Eliza Weisman
88685417f6
subscriber: prepare to release 0.2.17 (#1302)
# 0.2.17 (March 12, 2020)

### Fixed

- **fmt**: `Pretty` formatter now honors `with_ansi(false)` to disable
  ANSI terminal formatting ([#1240])
- **fmt**: Fixed extra padding when using `Pretty` formatter ([#1275])
- **chrono**: Removed extra trailing space with `ChronoLocal` time
  formatter ([#1103])

### Added

- **fmt**: Added `FmtContext::current_span()` method, returning the
  current span
  ([#1290])
- **fmt**: `FmtSpan` variants may now be combined using the `|` operator
  for more granular control over what span events are generated
  ([#1277])

Thanks to new contributors @cratelyn, @dignati, and @zicklag, as well as
@Folyd, @matklad, and @najamelan, for contributing to this release!

[#1240]: https://github.com/tokio-rs/tracing/pull/1240
[#1275]: https://github.com/tokio-rs/tracing/pull/1275
[#1103]: https://github.com/tokio-rs/tracing/pull/1103
[#1290]: https://github.com/tokio-rs/tracing/pull/1290
[#1277]: https://github.com/tokio-rs/tracing/pull/1277
2021-03-12 14:16:41 -08:00
Eliza Weisman
4538d74d22
subscriber: prepare to release v0.2.16 (#1256)
### Fixed

- **env-filter**: Fixed directives where the level is in mixed case
  (such as `Info`) failing to parse ([#1126])
- **fmt**: Fixed `fmt::Subscriber` not providing a max-level hint
  ([#1251])
- `tracing-subscriber` no longer enables `tracing` and `tracing-core`'s
  default features ([#1144])

### Changed

- **chrono**: Updated `chrono` dependency to 0.4.16 ([#1189])
- **log**: Updated `tracing-log` dependency to 0.1.2

Thanks to @salewski, @taiki-e, @davidpdrsn and @markdingram for
contributing to this release!

[#1126]: https://github.com/tokio-rs/tracing/pull/1126
[#1251]: https://github.com/tokio-rs/tracing/pull/1251
[#1144]: https://github.com/tokio-rs/tracing/pull/1144
[#1189]: https://github.com/tokio-rs/tracing/pull/1189

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2021-02-19 16:24:42 -08:00
Eliza Weisman
692c56f630
subscriber: prepare to release 0.2.15 (#1083)
### Fixed

- **fmt**: Fixed wrong lifetime parameters on `FormatFields` impl for
  `FmtContext` ([#1082])

### Added

- **fmt**: `format::Pretty`, an aesthetically pleasing, human-readable
  event formatter for local development and user-facing CLIs ([#1080])
- **fmt**: `FmtContext::field_format`, which returns the subscriber's
  field formatter ([#1082])

[#1082]: https://github.com/tokio-rs/tracing/pull/1082
[#1080]: https://github.com/tokio-rs/tracing/pull/1080
2020-11-02 15:51:36 -08:00
Eliza Weisman
3bc2fd35e6
subscriber: prepare to release 0.2.14 (#1065)
Fixed

- **registry**: Fixed `Registry::new` allocating an excessively large
  amount of memory, most of which would never be used ([#1064])

Changed

- **registry**: Improved `new_span` performance by reusing `HashMap`
  allocations for `Extensions` ([#1064])
- **registry**: Significantly improved the performance of
  `Registry::enter` and `Registry::exit` ([#1058])

[#1064]: https://github.com/tokio-rs/tracing/pull/1064
[#1058]: https://github.com/tokio-rs/tracing/pull/1058
2020-10-22 16:45:12 -07:00
Eliza Weisman
89418ee612
subscriber: prepare to release 0.2.13 (#1024)
### Changed

- Updated `tracing-core` to 0.1.17 ([#992])

### Added

- **env-filter**: Added support for filtering on targets which contain
  dashes ([#1014])
- **env-filter**: Added a warning when creating an `EnvFilter` that
  contains directives that would enable a level disabled by the
  `tracing` crate's `static_max_level` features ([#1021])

Thanks to @jyn514 and @bkchr for contributing to this release!

[#992]: https://github.com/tokio-rs/tracing/pull/992
[#1014]: https://github.com/tokio-rs/tracing/pull/1014
[#1021]: https://github.com/tokio-rs/tracing/pull/1021
2020-10-07 15:06:37 -07:00
Eliza Weisman
4b54cbc689
chore: fix nightly clippy warnings (#991) (#1025)
This backports PR #991 to v0.1.x. This is primarily necessary for the MSRV
bump, since some dependencies no longer compile on Rust 1.40.0.

This has already been approved on `master`, in PR #991, so it should be 
fine to ship.

## Motivation

This will avoid breaking CI on new releases of clippy. It also makes the
code a little easier to read.

## Solution

- Convert `match val { pat => true, _ => false }` to `matches!(val, pat)`
- Remove unnecessary closures
- Convert `self: &mut Self` to `&mut self`

This bumps the MSRV to 1.42.0 for `matches!`.
The latest version of rust is 1.46.0, so as per
https://github.com/tokio-rs/tracing#supported-rust-versions this is not
considered a breaking change.

I didn't fix the following warning because the fix was not trivial/needed
a decision:

```
warning: you are deriving `Ord` but have implemented `PartialOrd` explicitly
   --> tracing-subscriber/src/filter/env/field.rs:16:32
    |
16  | #[derive(Debug, Eq, PartialEq, Ord)]
    |                                ^^^
    |
    = note: `#[warn(clippy::derive_ord_xor_partial_ord)]` on by default
note: `PartialOrd` implemented here
   --> tracing-subscriber/src/filter/env/field.rs:98:1
    |
98  | / impl PartialOrd for Match {
99  | |     fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
100 | |         // Ordering for `Match` directives is based first on _whether_ a value
101 | |         // is matched or not. This is semantically meaningful --- we would
...   |
121 | |     }
122 | | }
    | |_^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_ord_xor_partial_ord
```

As a side note, this found a bug in clippy 😆 https://github.com/rust-lang/rust-clippy/issues/6089
2020-10-07 14:10:49 -07:00
Eliza Weisman
3dd5c03d90
subscriber: prepare to release 0.2.12 (#970)
# 0.2.12 (September 8, 2020)

### Fixed

- **env-filter**: Fixed a regression where `Option<Level>` lost its
  `Into<LevelFilter>` impl ([#966])
- **env-filter**: Fixed `EnvFilter` enabling spans that should not be enabled
  when multiple subscribers are in use ([#927])
  
### Changed

- **json**: `format::Json` now outputs fields in a more readable order ([#892])
- Updated `tracing-core` dependency to 0.1.16

### Added

- **fmt**: Add `BoxMakeWriter` for erasing the type of a `MakeWriter`
  implementation ([#958])
- **fmt**: Add `TestWriter` `MakeWriter` implementation to support libtest
  output capturing ([#938])
- **layer**: Add `Layer` impl for `Option<T> where T: Layer` ([#910])
- **env-filter**: Add `From<Level>` impl for `Directive` ([#918])
- Multiple documentation fixes and improvements

Thanks to @Pothulapati, @samrg472, @bryanburgers, @keetonian, 
and @SriRamanujam for contributing to this release!

[#927]: https://github.com/tokio-rs/tracing/pull/927
[#966]: https://github.com/tokio-rs/tracing/pull/966
[#958]: https://github.com/tokio-rs/tracing/pull/958
[#892]: https://github.com/tokio-rs/tracing/pull/892
[#938]: https://github.com/tokio-rs/tracing/pull/938
[#910]: https://github.com/tokio-rs/tracing/pull/910
[#918]: https://github.com/tokio-rs/tracing/pull/918
2020-09-08 20:16:56 -07:00
Eliza Weisman
3f8280ae69
docs: consistent MSRV docs & policy explanation (#941)
## Motivation

PR #934 fixed a bug in the CI configuration where MSRV checks were not
being run correctly. After this was fixed, it was necessary to bump the
MSRV to 1.40.0, as the tests were no longer actually passing on 1.39,
because some dependencies no longer support it.

While updating the documentation to indicate that the new MSRV is 1.40,
I noticed that the note on the MSRV was located inconsistently in the
READMEs and `lib.rs` documentation of various crates, and missing
entirely in some cases. Additionally, there have been some questions on
what our MSRV _policies_ are, and whether MSRV bumps are considered
breaking changes (see e.g. #936). 

## Solution

I've updated all the MSRV notes in the documentation and READMEs to
indicate that the MSRV is 1.40. I've also ensured that the MSRV note is
in the same place for every crate (at the end of the "Overview" section
in the docs), and that it's formatted consistently.

Furthermore, I added a new section to the READMEs and `lib.rs` docs
explaining the current MSRV policy in some detail. Hopefully, this
should answer questions like #936 in the future. The MSRV note in the
overview section includes a link to the section with further details.

Finally, while doing this, I noticed a couple of crates
(`tracing-journald` and `tracing-serde`) were missing top-level `lib.rs`
docs. Rather than just adding an MSRV note and nothing else, I went
ahead and fixed this using documentation from those crate's READMEs.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-08-18 12:11:16 -07:00
Eliza Weisman
e016e0435b
subscriber: prepare to release 0.2.11 (#916)
### Fixed

- **env-filter**: Incorrect max level hint when filters involving span
  field values are in use (#907)
- **registry**: Fixed inconsistent span stacks when multiple registries
  are in use on the same thread (#901)

### Changed

- **env-filter**: `regex` dependency enables fewer unused feature flags
  (#899)

Thanks to @bdonlan and @jeromegn for contributing to this release!
2020-08-10 17:38:32 -07:00
Eliza Weisman
bb8e977ab7
docs: fix broken splash graphic link (#913)
Somehow a single line of whitespace is load-bearing I guess? MARKDOWN!

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-08-10 15:24:31 -07:00
Eliza Weisman
2dd8fef355
subscriber: prepare to release 0.2.10 (#872)
### Fixed

- **docs**: Incorrect formatting (#862)

### Changed

- **filter**: `LevelFilter` is now a re-export of the
  `tracing_core::LevelFilter` type, it can now be used interchangably
  with the versions in `tracing` and `tracing-core` (#853)
- **filter**: Significant performance improvements when comparing
  `LevelFilter`s  and `Level`s (#853)
- Updated the minimum `tracing-core` dependency to 0.1.12 (#853)

### Added

- **filter**: `LevelFilter` and `EnvFilter` now participate in
  `tracing-core`'s max level hinting, improving performance
  significantly in some use cases where levels are disabled globally
  (#853)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-07-31 11:43:06 -07:00
Eliza Weisman
4c36130211
subscriber: prepare to release 0.2.9 (#846)
### Fixed

- **fmt**: Fixed compilation failure on MSRV when the `chrono` feature
  is disabled (#844)

### Added

- **fmt**: Span lookup methods defined by `layer::Context` are now also
  provided by `FmtContext` (#834)
2020-07-23 17:11:18 -07:00
Eliza Weisman
96e9d6d4f0
subscriber: prepare to release 0.2.8 (#823)
### Changed

- **fmt**: When the `chrono` dependency is enabled, the `SystemTime`
  timestamp now emits human-readable timestamps rather than using
  `SystemTime`'s fmt::Debug`implementation (`chrono` is still required
  for customized timestamp formatting) (#807)
- **ansi**: Updated `ansi_term` dependency to 0.12 (#816)

### Added

- **json**: `with_span_list` method to configure the JSON formatter to
  include a list of all spans in the current trace in formatting events
  (similarly to the text formatter) (#741)
- **json**: `with_current_span` method to configure the JSON formatter
  to include a field for the _current_ span (the leaf of the trace) in
  formatted events (#741)
- **fmt**: `with_thread_names` and `with_thread_ids` methods to
  configure `fmt::Subscriber`s and `fmt::Layer`s to include the thread
  name and/or thread ID of the current thread when formatting events
  (#818)

Thanks to new contributors @mockersf, @keetonian, and @Pothulapati for
contributing to this release!
2020-07-17 11:03:23 -07:00
Eliza Weisman
68556f2fe8
subscriber: prepare to release 0.2.7 (July 1, 2020) (#775)
### Changed

- **parking_lot**: Updated the optional `parking_lot` dependency to
  accept the latest `parking_lot` version (#774)

### Fixed

- **fmt**: Fixed events with explicitly overridden parent spans being
  formatted  as though they were children of the current span (#767)

### Added

- **fmt**: Added the option to print synthesized events when spans are
  created, entered, exited, and closed, including span durations (#761)
- Documentation clarification and improvement (#762, #769)

Thanks to @rkuhn, @greenwoodcm, and @Ralith for contributing to this
release!

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-07-01 09:43:54 -07:00
Eliza Weisman
971a46b46d
subscriber: prepare to release 0.2.6 (#757)
Fixed

- **fmt**: Fixed an issue in the JSON formatter where using
  `Span::record` would result in malformed spans (#709)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-06-19 09:55:47 -07:00
Eliza Weisman
351ac21809
subscriber: prepare to release 0.2.4 (#666)
# 0.2.4 (April 6, 2020)

This release includes several API ergonomics improvements, including
shorthand constructors for many types, and an extension trait for
initializing subscribers using method-chaining style. Additionally,
several bugs in less commonly used `fmt` APIs were fixed.

### Added

- **fmt**: Shorthand free functions for constructing most types in `fmt`
  (including `tracing_subscriber::fmt()` to return a
  `SubscriberBuilder`, `tracing_subscriber::fmt::layer()` to return a
  format `Layer`, etc) (#660)
- **registry**: Shorthand free function `tracing_subscriber::registry()`
  to construct a new registry (#660)
- Added `SubscriberInitExt` extension trait for more ergonomic
  subscriber initialization (#660)
  
### Changed

- **fmt**: Moved `LayerBuilder` methods to `Layer` (#655)

### Deprecated

- **fmt**: `LayerBuilder`, as `Layer` now implements all builder methods
  (#655)
  
### Fixed

- **fmt**: Fixed `Compact` formatter not omitting levels with
  `with_level(false)` (#657)
- **fmt**: Fixed `fmt::Layer` duplicating the fields for a new span if
  another layer has already formatted its fields (#634)
- **fmt**: Added missing space when using `record` to add new fields to
  a span that already has fields (#659)
- Updated outdated documentation (#647)


Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-04-06 10:21:48 -07:00
Eliza Weisman
83886fcc7c
subscriber: prepare to release 0.2.3 (#625)
# 0.2.3 (March 5, 2020)

### Fixed

- **env-filter**: Regression where filter directives were selected in the order
  they were listed, rather than most specific first (#624)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-03-05 14:49:52 -08:00
Lucio Franco
77e589906d
subscriber: Prepare 0.2.2 release (#609)
### Added

- **fmt**: Added `flatten_event` to `SubscriberBuilder` (#599)
- **fmt**: Added `with_level` to `SubscriberBuilder` (#594)

Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
2020-02-27 16:13:29 -08:00
Eliza Weisman
4dad420ee1
subscriber: prepare to release 0.2.1 (#586)
### Changed

- **filter**: `EnvFilter` directive selection now behaves correctly
  (i.e. like `env_logger`) (#583)

### Fixed

- **filter**: Fixed `EnvFilter` incorrectly allowing less-specific
  filter directives to enable events that are disabled by more-specific
  filters (#583)
- **filter**: Multiple significant `EnvFilter`  performance
  improvements, especially when filtering events generated by `log`
  records (#578, #583)
- **filter**: Replaced `BTreeMap` with `Vec` in `DirectiveSet`,
  improving iteration performance significantly with typical numbers of
  filter directives (#580)

A big thank-you to @samschlegel for lots of help with `EnvFilter` 
performance tuning in this release!

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-02-14 10:56:03 -08:00
Eliza Weisman
8711f63cd8
subscriber: prepare to release 0.2.0 stable (#567)
# 0.2.0 (February 4, 2020)

### Breaking Changes

- **fmt**: Renamed `Context` to `FmtContext` (#420, #425)
- **fmt**: Renamed `Builder` to `SubscriberBuilder` (#420)
- **filter**: Removed `Filter`. Use `EnvFilter` instead (#434)

### Added

- **registry**: `Registry`, a `Subscriber` implementation that `Layer`s
  can use as a high-performance, in-memory span store. (#420, #425, 
  #432, #433, #435)
- **registry**: Added `LookupSpan` trait, implemented by `Subscriber`s
  to expose stored span data to `Layer`s (#420)
- **fmt**: Added `fmt::Layer`, to allow composing log formatting with
  other `Layer`s
- **fmt**: Added support for JSON field and event formatting (#377, 
  #415)
- **filter**: Documentation for filtering directives (#554)

### Changed

- **fmt**: Renamed `Context` to `FmtContext` (#420, #425) (BREAKING)
- **fmt**: Renamed `Builder` to `SubscriberBuilder` (#420) (BREAKING)
- **fmt**: Reimplemented `fmt::Subscriber` in terms of the `Registry`
  and `Layer`s (#420)

### Removed

- **filter**: Removed `Filter`. Use `EnvFilter` instead (#434) 
  (BREAKING)

### Fixed

- **fmt**: Fixed memory leaks in the slab used to store per-span data
  (3c35048)
- **fmt**: `fmt::SubscriberBuilder::init` not setting up `log` 
  compatibility (#489)
- **fmt**: Spans closed by a child span closing not also closing 
  _their_ parents (#514)
- **Layer**: Fixed `Layered` subscribers failing to downcast to their
  own type (#549)
- **Layer**: Fixed `Layer::downcast_ref` returning invalid references
  (#454)

Fixes #515
Fixes #458 

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-02-04 15:30:46 -08:00
Eliza Weisman
6229025973
subscriber: prepare to release 0.2.0-alpha.6 (#561)
Fixed

- **fmt**: Fixed empty `{}` printed after spans with no fields (f079f2d)
- **fmt**: Fixed inconsistent formatting when ANSI colors are disabled (506a482)
- **fmt**: Fixed mis-aligned levels when ANSI colors are disabled (eba1adb)
- Fixed warnings on nightly Rust compilers (#558)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-02-03 14:21:55 -08:00
Eliza Weisman
c889311821
subscriber: prepare to release 0.2.0-alpha.5 (#555)
### Added:

- **env_filter**: Documentation for filtering directives (#554)
- **registry**, **env_filter**: Updated `smallvec` dependency to 0.1
  (#543)

### Fixed:

- **registry**: Fixed a memory leak in the slab used to store per-span
  data (3c35048)
- **Layer**: Fixed `Layered` subscribers failing to downcast to their
  own type (#549)
- **fmt**: Fixed a panic when multiple layers insert `FormattedFields`
  extensions from the same formatter type (1c3bb70)
- **fmt**: Fixed `fmt::Layer::on_record` inserting a new
  `FormattedFields` when  formatted fields for a span already exist
  (1c3bb70)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-01-31 14:59:32 -08:00
Eliza Weisman
bdddf10d99
subscriber: prepare to release 0.2.0-alpha.4 (#534)
# 0.2.0-alpha.4 (January 11, 2020)

### Fixed

- **registry**: Removed inadvertently committed `dbg!` macros (#533)
2020-01-11 11:23:38 -08:00
Eliza Weisman
c6f74ea0f8
subscriber: prepare to release 0.2.0-alpha.3 (#529)
* subscriber: prepare to release 0.2.0-alpha.3

### Added

- **fmt**: Public `FormattedFields::new` constructor (#478)
- **fmt**: Added examples to `fmt::Layer` documentation (#510)
- Documentation now shows what feature flags are required by each API item (#525)

### Fixed

- **fmt**: Missing space between timestamp and level (#480)
- **fmt**: Incorrect formatting with `with_target(false)` (#481)
- **fmt**: `fmt::SubscriberBuilder::init` not setting up `log` compatibility
  (#489)
- **registry**: Spans exited out of order not being closed properly on exit
  (#509)
- **registry**: Memory leak when spans are closed by a child span closing (#514)
- **registry**: Spans closed by a child span closing not also closing _their_
  parents (#514)
- Compilation errors with `no-default-features` (#499, #500)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2020-01-10 16:39:22 -08:00
Eliza Weisman
7856483fcf
chore: update README links/badges (#485)
This branch updates all the README links and badges. In particular, it:

* Changes build status badges to GitHub Actions, since we've turned off
  the Azure Pipelines CI build,
* Removes Gitter links, since nobody is on Gitter these days and we
  probably don't want to point new users to an empty chat room,
* Make Discord links "actually work"

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-12-20 14:14:52 -08:00
Eliza Weisman
aa7ed533e6
subscriber: prepare to release 0.1.5 (#375)
### Fixed

- Spans not being closed properly after calling
  `FmtSubscriber::current_span` (#371)
2019-10-07 13:29:26 -07:00
Eliza Weisman
945c481bd5
chore: add discord links to READMEs (#370)
Tokio is experimenting with Discord, and the Tokio discord server has
a Tracing channel. This PR adds Discord links to READMEs.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-10-01 17:23:27 -07:00
Eliza Weisman
4205c08d29
subscriber: prepare to release 0.1.4 (#363)
### Fixed:

- Spans entered twice on the same thread sometimes being completely
  exited when the more deeply-nested entry is exited (#361)
- Setting `with_ansi(false)` on `FmtSubscriber` not disabling ANSI color
  formatting for timestamps (#354)
- Incorrect reference counting in `FmtSubscriber` that could cause spans
  to not be closed when all references are dropped (#366)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-09-26 14:02:23 -07:00
Eliza Weisman
26f8c53d20
subscriber: prepare to release 0.1.3 (#351)
Fixed:

- `Layered` subscribers not properly forwarding calls to `current_span`
  (#350)

Signed-off-by: hawkw <eliza@buoyant.io>
2019-09-16 14:18:20 -07:00
Eliza Weisman
9cb629e602
subscriber: prepare to release 0.1.2 (#347)
### Fixed

- `EnvFilter` ignoring directives with targets that are the same number
  of characters (#333)
- `EnvFilter` failing to properly apply filter directives to events
  generated from `log` records by`tracing-log` (#344)

### Changed

- Renamed `Filter` to `EnvFilter`, deprecated `Filter` (#339)
- Renamed "filter" feature flag to "env-filter", deprecated "filter" (#339)
- `FmtSubscriber` now defaults to enabling only the `INFO` level and
  above when a max level filter or `EnvFilter` is not set (#336)

### Added:

- `EnvFilter::add_directive` to add new directives to filters after they
  are constructed (#334)
- `fmt::Builder::with_max_level` to set a global level filter for a
  `FmtSubscriber` without requiring the use of `EnvFilter` (#336)
- `Layer` implementation for `LevelFilter` (#336)
- `EnvFilter` now implements `fmt::Display` (#329)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2019-09-13 14:10:56 -07:00
David Barsky
c38c247f53 chore: publish docs tracing for master + PR branches (#322)
chore: build and publish documentation for each branch.

This commit introduces support for:
- building and deploying documentation for the master branch
- building and deploying (preview) documentation for each pull request
  and for each PR
- adds a link in `README.md` pointing to the generated documentation
  for the master branch
- notes the per-PR documentation previews in `CONTRIBUTING.md`

Closes #210
2019-09-04 12:51:30 -07:00