Skip to content

Commit 6f00dbd

Browse files
authored
log: prepare to release 0.1.1 (#413)
* log: deprecate `TraceLogger` This deprecation was discussed in #369 (comment). This API should not be used, as the `tracing` crate's `log` and `log-always` features provide better implementations of the same functionality, and the implementation here contains some deadlocks that make it unusable in real-world use-cases. Closes #369 Signed-off-by: Eliza Weisman <[email protected]> * log: minor readme tweaks - Improve list of provded APIs - Remove Gitter Signed-off-by: Eliza Weisman <[email protected]> * log: prepare to release 0.1.1 ### Deprecated - `TraceLogger` (use `tracing`'s "log" and "log-always" feature flags instead) ### Fixed - Issues with `log/std` feature flag (#406) - Minor documentation issues (#405, #408) * fix deprecation warning on reexport * rustfmt Signed-off-by: Eliza Weisman <[email protected]>
1 parent 5dc2b15 commit 6f00dbd

File tree

4 files changed

+39
-18
lines changed

4 files changed

+39
-18
lines changed

tracing-log/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 0.1.1 (October 29, 2019)
2+
3+
### Deprecated
4+
5+
- `TraceLogger` (use `tracing`'s "log" and "log-always" feature flags instead)
6+
7+
### Fixed
8+
9+
- Issues with `log/std` feature flag (#406)
10+
- Minor documentation issues (#405, #408)
11+
112
# 0.1.0 (September 3, 2019)
213

314
- Initial release

tracing-log/README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@
77
[![Documentation (master)][docs-master-badge]][docs-master-url]
88
[![MIT licensed][mit-badge]][mit-url]
99
[![Build Status][azure-badge]][azure-url]
10-
[![Gitter chat][gitter-badge]][gitter-url]
1110
[![Discord chat][discord-badge]][discord-url]
1211
![maintenance status][maint-badge]
1312

1413

15-
[Documentation][docs-url] |
16-
[Chat (gitter)][gitter-url] | [Chat (discord)][discord-url]
14+
[Documentation][docs-url] | [Chat (discord)][discord-url]
1715

1816

1917
[crates-badge]: https://img.shields.io/crates/v/tracing-log.svg
@@ -26,8 +24,6 @@
2624
[mit-url]: LICENSE
2725
[azure-badge]: https://dev.azure.com/tracing/tracing/_apis/build/status/tokio-rs.tracing?branchName=master
2826
[azure-url]: https://dev.azure.com/tracing/tracing/_build/latest?definitionId=1&branchName=master
29-
[gitter-badge]: https://img.shields.io/gitter/room/tokio-rs/tracing.svg
30-
[gitter-url]: https://gitter.im/tokio-rs/tracing
3127
[discord-badge]: https://img.shields.io/discord/500028886025895936?logo=discord&label=discord&logoColor=white
3228
[discord-url]: https://discordapp.com/invite/XdPzyTZ
3329
[maint-badge]: https://img.shields.io/badge/maintenance-experimental-blue.svg
@@ -41,16 +37,17 @@ by the [`log`] crate.
4137

4238
This crate provides:
4339

40+
- [`AsTrace`] and [`AsLog`] traits for converting between `tracing` and `log` types.
4441
- [`LogTracer`], a [`log::Log`] implementation that consumes [`log::Record`]s
45-
and outputs them as [`tracing::Event`].
46-
- [`TraceLogger`], a [`tracing::Subscriber`] implementation that consumes
47-
[`tracing::Event`]s and outputs [`log::Record`], allowing an existing logger
48-
implementation to be used to record trace events.
42+
and outputs them as [`tracing::Event`]s.
43+
- An [`env_logger`] module, with helpers for using the [`env_logger` crate]
44+
with `tracing` (optional, enabled by the `env-logger` feature).
4945

5046
[`tracing`]: https://crates.io/crates/tracing
5147
[`log`]: https://crates.io/crates/log
48+
[`AsTrace`]: https://docs.rs/tracing-log/latest/tracing_log/trait.AsTrace.html
49+
[`AsLog`]: https://docs.rs/tracing-log/latest/tracing_log/trait.AsLog.html
5250
[`LogTracer`]: https://docs.rs/tracing-log/latest/tracing_log/struct.LogTracer.html
53-
[`TraceLogger`]: https://docs.rs/tracing-log/latest/tracing_log/struct.TraceLogger.html
5451
[`log::Log`]: https://docs.rs/log/latest/log/trait.Log.html
5552
[`log::Record`]: https://docs.rs/log/latest/log/struct.Record.html
5653
[`tracing::Subscriber`]: https://docs.rs/tracing/latest/tracing/trait.Subscriber.html

tracing-log/src/lib.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
//! - [`AsTrace`] and [`AsLog`] traits for converting between `tracing` and `log` types.
1414
//! - [`LogTracer`], a [`log::Log`] implementation that consumes [`log::Record`]s
1515
//! and outputs them as [`tracing::Event`].
16-
//! - [`TraceLogger`], a [`tracing::Subscriber`] implementation that consumes
17-
//! [`tracing::Event`]s and outputs [`log::Record`], allowing an existing logger
18-
//! implementation to be used to record trace events.
1916
//! - An [`env_logger`] module, with helpers for using the [`env_logger` crate]
2017
//! with `tracing` (optional, enabled by the `env-logger` feature).
2118
//!
@@ -50,8 +47,9 @@
5047
//!
5148
//! ## Convert tracing `Event`s to logs
5249
//!
53-
//! This conversion can be done with [`TraceLogger`], a [`Subscriber`] which
54-
//! records `tracing` spans and events and outputs log records.
50+
//! Enabling the ["log" and "log-always" feature flags][flags] on the `tracing`
51+
//! crate will cause all `tracing` spans and events to emit `log::Record`s as
52+
//! they occur.
5553
//!
5654
//! ## Caution: Mixing both conversions
5755
//!
@@ -67,8 +65,8 @@
6765
//! required to avoid infinitely converting between `Event` and `log::Record`.
6866
//!
6967
//! # Feature Flags
70-
//!
71-
//! * `trace-logger`: enables the `TraceLogger` type (on by default)
68+
//! * `trace-logger`: enables an experimental `log` subscriber, deprecated since
69+
//! version 0.1.1.
7270
//! * `log-tracer`: enables the `LogTracer` type (on by default)
7371
//! * `env_logger`: enables the `env_logger` module, with helpers for working
7472
//! with the [`env_logger` crate].
@@ -138,6 +136,11 @@ pub mod trace_logger;
138136
pub use self::log_tracer::LogTracer;
139137

140138
#[cfg(feature = "trace-logger")]
139+
#[deprecated(
140+
since = "0.1.1",
141+
note = "use the `tracing` crate's \"log\" feature flag instead"
142+
)]
143+
#[allow(deprecated)]
141144
#[doc(inline)]
142145
pub use self::trace_logger::TraceLogger;
143146

tracing-log/src/trace_logger.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
//! When a [`TraceLogger`] is set as the current subscriber, it will record
55
//! traces by emitting [`log::Record`]s that can be collected by a logger.
66
//!
7+
//! **Note**: This API has been deprecated since version 0.1.1. In order to emit
8+
//! `tracing` events as `log` records, the ["log" and "log-always" feature
9+
//! flags][flags] on the `tracing` crate should be used instead.
10+
//!
711
//! [`log`]: https://docs.rs/log/0.4.8/log/index.html
812
//! [`Subscriber`]: https://docs.rs/tracing/0.1.7/tracing/subscriber/trait.Subscriber.html
913
//! [`TraceLogger`]: struct.TraceLogger.html
1014
//! [`log::Record`]: https://docs.rs/log/0.4.8/log/struct.Record.html
15+
//! [flags]: https://docs.rs/tracing/0.1.10/tracing/#crate-feature-flags
16+
#![deprecated(since = "0.1.1", note = "use the `tracing` crate's \"log\" feature flag instead")]
1117
use crate::AsLog;
1218
use std::{
1319
cell::RefCell,
@@ -27,7 +33,11 @@ use tracing_core::{
2733
/// A `tracing` [`Subscriber`] implementation that logs all recorded
2834
/// trace events.
2935
///
30-
//. [`Subscriber`]: https://docs.rs/tracing/0.1.7/tracing/subscriber/trait.Subscriber.html
36+
/// **Note**: This API has been deprecated since version 0.1.1. In order to emit
37+
/// `tracing` events as `log` records, the ["log" and "log-always" feature
38+
/// flags][flags] on the `tracing` crate should be used instead.
39+
///
40+
/// [`Subscriber`]: https://docs.rs/tracing/0.1.7/tracing/subscriber/trait.Subscriber.html
3141
pub struct TraceLogger {
3242
settings: Builder,
3343
spans: Mutex<HashMap<Id, SpanLineBuilder>>,

0 commit comments

Comments
 (0)