mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-20 00:00:08 +02:00
## Motivation The `tracing` crate implements scoped, structured, context-aware diagnostics, which can add significant debugging value over unstructured log messages. `tracing` is part of the Tokio project. As part of the `tokio` 0.2 changes, I thought it would be good to move over from `log` to `tracing` in the tokio runtime. Updating the executor crate is an obvious starting point. ## Solution This branch replaces the use of `log` in `tokio-executor` with `tracing`. I've tried to leave all the instrumentation points more or less the same, but modified to use structured fields instead of string interpolation. I've also added a few `tracing` spans, primarily in places where a variable is added to all the log messages in a scope. ## Notes For users who are using the legacy `log` output, there is a feature flag to enable `log` support in `tracing`. I thought about making this on by default, but that would also enable the `tracing` dependency by default, and it is only pulled in when the `threadpool` feature flag is enabled. The `tokio` crate could enable the log feature in its default features instead, since the threadpool feature is on by default in `tokio`. If this isn't the right approach, I can change how `log` back-compatibility is enabled. We might want to consider adding more `tracing` spans in the threadpool later. This could be useful for profiling, and for helping users debug the way their applications interact with the executor. This branch is just intended as a starting point so that we can begin emitting `tracing` data from the executor; we should revisit what instrumentation should be exposed, as well. Signed-off-by: Eliza Weisman <[email protected]>
64 lines
1.8 KiB
TOML
64 lines
1.8 KiB
TOML
[package]
|
|
name = "tokio-executor"
|
|
# When releasing to crates.io:
|
|
# - Remove path dependencies
|
|
# - Update html_root_url.
|
|
# - Update doc url
|
|
# - Cargo.toml
|
|
# - Update CHANGELOG.md.
|
|
# - Create "v0.2.x" git tag.
|
|
version = "0.2.0-alpha.2"
|
|
edition = "2018"
|
|
documentation = "https://docs.rs/tokio-executor/0.2.0-alpha.2/tokio_executor"
|
|
repository = "https://github.com/tokio-rs/tokio"
|
|
homepage = "https://github.com/tokio-rs/tokio"
|
|
license = "MIT"
|
|
authors = ["Tokio Contributors <[email protected]>"]
|
|
description = """
|
|
Future execution primitives
|
|
"""
|
|
keywords = ["futures", "tokio"]
|
|
categories = ["concurrency", "asynchronous"]
|
|
|
|
[features]
|
|
current-thread = ["crossbeam-channel"]
|
|
threadpool = [
|
|
"tokio-sync",
|
|
"crossbeam-deque",
|
|
"crossbeam-queue",
|
|
"crossbeam-utils",
|
|
"futures-core-preview",
|
|
"futures-util-preview",
|
|
"num_cpus",
|
|
"lazy_static",
|
|
"slab",
|
|
]
|
|
|
|
[dependencies]
|
|
tokio-sync = { version = "=0.2.0-alpha.2", optional = true, path = "../tokio-sync" }
|
|
|
|
tracing = { version = "0.1.5", optional = true }
|
|
|
|
# current-thread dependencies
|
|
crossbeam-channel = { version = "0.3.8", optional = true }
|
|
|
|
# threadpool dependencies
|
|
crossbeam-deque = { version = "0.7.0", optional = true }
|
|
crossbeam-queue = { version = "0.1.0", optional = true }
|
|
crossbeam-utils = { version = "0.6.4", optional = true }
|
|
futures-core-preview = { version = "=0.3.0-alpha.18", optional = true }
|
|
futures-util-preview = { version = "=0.3.0-alpha.18", optional = true }
|
|
num_cpus = { version = "1.2", optional = true }
|
|
lazy_static = { version = "1", optional = true }
|
|
slab = { version = "0.4.1", optional = true }
|
|
|
|
[dev-dependencies]
|
|
tokio = { version = "0.2.0-alpha.1", path = "../tokio" }
|
|
tokio-test = { version = "0.2.0-alpha.1", path = "../tokio-test" }
|
|
|
|
futures-core-preview = "=0.3.0-alpha.18"
|
|
rand = "0.7"
|
|
|
|
[package.metadata.docs.rs]
|
|
all-features = true
|