Skip to content

Commit

Permalink
Merge branch 'master' into davidbarsky/have-pretty-field-formatter-re…
Browse files Browse the repository at this point in the history
…ad-writer-config
  • Loading branch information
davidbarsky committed Nov 24, 2021
2 parents 85b4463 + a36cb8f commit c90d22b
Show file tree
Hide file tree
Showing 43 changed files with 117 additions and 172 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -129,7 +129,7 @@ use std::{error::Error, io};
use tracing::{debug, error, info, span, warn, Level};

// the `#[tracing::instrument]` attribute creates and enters a span
// every time the instrumented function is called. The span is named after the
// every time the instrumented function is called. The span is named after
// the function or method. Parameters passed to the function are recorded as fields.
#[tracing::instrument]
pub fn shave(yak: usize) -> Result<(), Box<dyn Error + 'static>> {
Expand Down
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Expand Up @@ -3,7 +3,7 @@ name = "tracing-examples"
version = "0.0.0"
publish = false
edition = "2018"
rust = "1.42.0"
rust-version = "1.42.0"

[features]
default = []
Expand Down
4 changes: 2 additions & 2 deletions examples/examples/fmt/yak_shave.rs
Expand Up @@ -4,7 +4,7 @@ use thiserror::Error;
use tracing::{debug, error, info, span, trace, warn, Level};

// the `#[tracing::instrument]` attribute creates and enters a span
// every time the instrumented function is called. The span is named after the
// every time the instrumented function is called. The span is named after
// the function or method. Paramaters passed to the function are recorded as fields.
#[tracing::instrument]
pub fn shave(yak: usize) -> Result<(), Box<dyn Error + 'static>> {
Expand Down Expand Up @@ -47,7 +47,7 @@ pub fn shave_all(yaks: usize) -> usize {

if let Err(ref error) = res {
// Like spans, events can also use the field initialization shorthand.
// In this instance, `yak` is the field being initalized.
// In this instance, `yak` is the field being initialized.
error!(yak, error = error.as_ref(), "failed to shave yak");
} else {
yaks_shaved += 1;
Expand Down
2 changes: 1 addition & 1 deletion tracing-appender/Cargo.toml
Expand Up @@ -18,7 +18,7 @@ categories = [
]
keywords = ["logging", "tracing", "file-appender", "non-blocking-writer"]
edition = "2018"
rust = "1.51.0"
rust-version = "1.51.0"

[dependencies]
crossbeam-channel = "0.5.0"
Expand Down
2 changes: 1 addition & 1 deletion tracing-appender/src/inner.rs
Expand Up @@ -76,7 +76,7 @@ impl InnerAppender {
}

fn should_rollover(&self, date: OffsetDateTime) -> bool {
// the `None` case means that the `InnerAppender` *never* rorates log files.
// the `None` case means that the `InnerAppender` *never* rotates log files.
match self.next_date {
None => false,
Some(next_date) => date >= next_date,
Expand Down
2 changes: 1 addition & 1 deletion tracing-attributes/Cargo.toml
Expand Up @@ -28,7 +28,7 @@ keywords = ["logging", "tracing", "macro", "instrument", "log"]
license = "MIT"
readme = "README.md"
edition = "2018"
rust = "1.42.0"
rust-version = "1.42.0"

[lib]
proc-macro = true
Expand Down
2 changes: 1 addition & 1 deletion tracing-core/Cargo.toml
Expand Up @@ -24,7 +24,7 @@ categories = [
]
keywords = ["logging", "tracing", "profiling"]
edition = "2018"
rust = "1.42.0"
rust-version = "1.42.0"

[features]
default = ["std"]
Expand Down
1 change: 1 addition & 0 deletions tracing-core/src/callsite.rs
Expand Up @@ -67,6 +67,7 @@ pub use self::inner::{rebuild_interest_cache, register};
#[cfg(feature = "std")]
mod inner {
use super::*;
use lazy_static::lazy_static;
use std::sync::RwLock;
use std::vec::Vec;

Expand Down
3 changes: 1 addition & 2 deletions tracing-core/src/collect.rs
Expand Up @@ -239,8 +239,7 @@ pub trait Collect: 'static {
/// but values for them won't be recorded at this time.
///
/// ```rust,ignore
/// #[macro_use]
/// extern crate tracing;
/// # use tracing::span;
///
/// let mut span = span!("my_span", foo = 3, bar, baz);
///
Expand Down
5 changes: 0 additions & 5 deletions tracing-core/src/lib.rs
Expand Up @@ -274,11 +274,6 @@ macro_rules! metadata {
};
}

// std uses lazy_static from crates.io
#[cfg(feature = "std")]
#[macro_use]
extern crate lazy_static;

// Facade module: `no_std` uses spinlocks, `std` uses the mutexes in the standard library
#[cfg(not(feature = "std"))]
#[doc(hidden)]
Expand Down
2 changes: 1 addition & 1 deletion tracing-error/Cargo.toml
Expand Up @@ -32,7 +32,7 @@ keywords = [
"backtrace"
]
edition = "2018"
rust = "1.42.0"
rust-version = "1.42.0"

[features]
default = ["traced-error"]
Expand Down
2 changes: 1 addition & 1 deletion tracing-flame/Cargo.toml
Expand Up @@ -19,7 +19,7 @@ categories = [
"asynchronous",
]
keywords = ["tracing", "subscriber", "flamegraph", "profiling"]
rust = "1.42.0"
rust-version = "1.42.0"

[features]
default = ["smallvec"]
Expand Down
2 changes: 1 addition & 1 deletion tracing-futures/Cargo.toml
Expand Up @@ -16,7 +16,7 @@ categories = [
]
keywords = ["logging", "profiling", "tracing", "futures", "async"]
license = "MIT"
rust = "1.42.0"
rust-version = "1.42.0"

[features]
default = ["std-future", "std"]
Expand Down
2 changes: 1 addition & 1 deletion tracing-journald/Cargo.toml
Expand Up @@ -13,7 +13,7 @@ categories = [
"development-tools::profiling",
]
keywords = ["tracing", "journald"]
rust = "1.42.0"
rust-version = "1.42.0"

[dependencies]
tracing-core = { path = "../tracing-core", version = "0.2" }
Expand Down
2 changes: 1 addition & 1 deletion tracing-log/Cargo.toml
Expand Up @@ -15,7 +15,7 @@ categories = [
keywords = ["logging", "tracing", "log"]
license = "MIT"
readme = "README.md"
rust = "1.42.0"
rust-version = "1.42.0"

[features]
default = ["log-tracer", "std"]
Expand Down
2 changes: 1 addition & 1 deletion tracing-macros/Cargo.toml
Expand Up @@ -15,7 +15,7 @@ categories = [
]
keywords = ["logging", "tracing"]
license = "MIT"
rust = "1.42.0"
rust-version = "1.42.0"

[dependencies]
tracing = { path = "../tracing", version = "0.2", default-features = false, features = ["std"] }
Expand Down
2 changes: 1 addition & 1 deletion tracing-opentelemetry/Cargo.toml
Expand Up @@ -17,7 +17,7 @@ categories = [
keywords = ["tracing", "opentelemetry", "jaeger", "zipkin", "async"]
license = "MIT"
edition = "2018"
rust = "1.42.0"
rust-version = "1.42.0"

[features]
default = ["tracing-log"]
Expand Down
2 changes: 1 addition & 1 deletion tracing-serde/Cargo.toml
Expand Up @@ -16,7 +16,7 @@ categories = [
"encoding",
]
keywords = ["logging", "tracing", "serialization"]
rust = "1.42.0"
rust-version = "1.42.0"

[features]
default = ["std"]
Expand Down
4 changes: 0 additions & 4 deletions tracing-serde/README.md
Expand Up @@ -53,10 +53,6 @@ tracing-serde = "0.1"
Next, add this to your crate:

```rust
#[macro_use]
extern crate tracing;
extern crate tracing_serde;

use tracing_serde::AsSerde;
```

Expand Down
2 changes: 1 addition & 1 deletion tracing-subscriber/Cargo.toml
Expand Up @@ -20,7 +20,7 @@ categories = [
"asynchronous",
]
keywords = ["logging", "tracing", "metrics", "subscriber"]
rust = "1.42.0"
rust-version = "1.42.0"

[features]

Expand Down
2 changes: 1 addition & 1 deletion tracing-tower/Cargo.toml
Expand Up @@ -15,7 +15,7 @@ categories = [
]
keywords = ["logging", "tracing"]
license = "MIT"
rust = "1.42.0"
rust-version = "1.42.0"

[features]
default = ["tower-layer", "tower-make"]
Expand Down
2 changes: 1 addition & 1 deletion tracing/Cargo.toml
Expand Up @@ -28,7 +28,7 @@ categories = [
]
keywords = ["logging", "tracing", "metrics", "async"]
edition = "2018"
rust = "1.42.0"
rust-version = "1.42.0"

[dependencies]
tracing-core = { path = "../tracing-core", version = "0.2", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion tracing/README.md
Expand Up @@ -144,7 +144,7 @@ use std::{error::Error, io};
use tracing::{debug, error, info, span, warn, Level};

// the `#[tracing::instrument]` attribute creates and enters a span
// every time the instrumented function is called. The span is named after the
// every time the instrumented function is called. The span is named after
// the function or method. Paramaters passed to the function are recorded as fields.
#[tracing::instrument]
pub fn shave(yak: usize) -> Result<(), Box<dyn Error + 'static>> {
Expand Down
3 changes: 0 additions & 3 deletions tracing/benches/global_subscriber.rs
@@ -1,6 +1,3 @@
extern crate criterion;
extern crate tracing;

use criterion::{black_box, criterion_group, criterion_main, Criterion};
use tracing::Level;

Expand Down
3 changes: 0 additions & 3 deletions tracing/benches/subscriber.rs
@@ -1,6 +1,3 @@
extern crate criterion;
extern crate tracing;

use criterion::{black_box, criterion_group, criterion_main, Criterion};
use tracing::Level;

Expand Down
2 changes: 1 addition & 1 deletion tracing/src/level_filters.rs
Expand Up @@ -65,7 +65,7 @@ pub use tracing_core::{metadata::ParseLevelFilterError, LevelFilter};
/// [module-level documentation]: self#compile-time-filters
pub const STATIC_MAX_LEVEL: LevelFilter = MAX_LEVEL;

cfg_if! {
cfg_if::cfg_if! {
if #[cfg(all(not(debug_assertions), feature = "release_max_level_off"))] {
const MAX_LEVEL: LevelFilter = LevelFilter::OFF;
} else if #[cfg(all(not(debug_assertions), feature = "release_max_level_error"))] {
Expand Down
7 changes: 2 additions & 5 deletions tracing/src/lib.rs
Expand Up @@ -482,7 +482,7 @@
//! use tracing::{debug, error, info, span, warn, Level};
//!
//! // the `#[tracing::instrument]` attribute creates and enters a span
//! // every time the instrumented function is called. The span is named after the
//! // every time the instrumented function is called. The span is named after
//! // the function or method. Parameters passed to the function are recorded as fields.
//! #[tracing::instrument]
//! pub fn shave(yak: usize) -> Result<(), Box<dyn Error + 'static>> {
Expand Down Expand Up @@ -524,7 +524,7 @@
//!
//! if let Err(ref error) = res {
//! // Like spans, events can also use the field initialization shorthand.
//! // In this instance, `yak` is the field being initalized.
//! // In this instance, `yak` is the field being initialized.
//! error!(yak, error = error.as_ref(), "failed to shave yak!");
//! } else {
//! yaks_shaved += 1;
Expand Down Expand Up @@ -929,9 +929,6 @@
while_true
)]

#[macro_use]
extern crate cfg_if;

#[cfg(feature = "log")]
#[doc(hidden)]
pub use log;
Expand Down
2 changes: 1 addition & 1 deletion tracing/src/span.rs
Expand Up @@ -915,7 +915,7 @@ impl Span {
/// ```
///
/// If the current [collector] enables the [`DEBUG`] level, then both
/// the "parent" and "child" spans will be enabled. Thus, when the "spawaned
/// the "parent" and "child" spans will be enabled. Thus, when the "spawned
/// a thread!" event occurs, it will be inside of the "child" span. Because
/// "parent" is the parent of "child", the event will _also_ be inside of
/// "parent".
Expand Down
1 change: 0 additions & 1 deletion tracing/test-log-support/src/lib.rs
@@ -1,4 +1,3 @@
extern crate log;
use log::{LevelFilter, Log, Metadata, Record};
use std::sync::{Arc, Mutex};

Expand Down
6 changes: 1 addition & 5 deletions tracing/test-log-support/tests/log_no_trace.rs
@@ -1,9 +1,5 @@
#[macro_use]
extern crate tracing;
extern crate test_log_support;

use test_log_support::Test;
use tracing::Level;
use tracing::{error, info, span, trace, warn, Level};

#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
Expand Down
6 changes: 1 addition & 5 deletions tracing/test-log-support/tests/log_with_trace.rs
@@ -1,9 +1,5 @@
#[macro_use]
extern crate tracing;
extern crate test_log_support;

use test_log_support::Test;
use tracing::Level;
use tracing::{error, info, span, trace, warn, Level};
use tracing_core::span::Current;

pub struct NopCollector;
Expand Down
@@ -1,9 +1,5 @@
#[macro_use]
extern crate tracing;
extern crate test_log_support;

use test_log_support::Test;
use tracing::Level;
use tracing::{error, info, span, trace, warn, Level};

#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
Expand Down
@@ -1,9 +1,5 @@
#[macro_use]
extern crate tracing;
extern crate test_log_support;

use test_log_support::Test;
use tracing::Level;
use tracing::{error, info, span, trace, warn, Level};

#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
Expand Down
@@ -1,9 +1,5 @@
#[macro_use]
extern crate tracing;
extern crate test_log_support;

use test_log_support::Test;
use tracing::Level;
use tracing::{error, info, span, trace, warn, Level};

#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
Expand Down
6 changes: 1 addition & 5 deletions tracing/test-log-support/tests/span_lifecycle_is_trace.rs
@@ -1,9 +1,5 @@
#[macro_use]
extern crate tracing;
extern crate test_log_support;

use test_log_support::Test;
use tracing::Level;
use tracing::{error, info, span, trace, warn, Level};

#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
#[test]
Expand Down
5 changes: 1 addition & 4 deletions tracing/test_static_max_level_features/tests/test.rs
@@ -1,9 +1,6 @@
#[macro_use]
extern crate tracing;

use std::sync::{Arc, Mutex};
use tracing::span::{Attributes, Record};
use tracing::{span, Collect, Event, Id, Level, Metadata};
use tracing::{debug, error, info, span, trace, warn, Collect, Event, Id, Level, Metadata};
use tracing_core::span::Current;

struct State {
Expand Down

0 comments on commit c90d22b

Please sign in to comment.