Skip to content

fmt: Missing space between multiple values for the same key on a span #627

Closed
@bazaah

Description

@bazaah

Version

tracing v0.1.13
│ ├── tracing-attributes v0.1.7
│ └── tracing-core v0.1.10
└── tracing-subscriber v0.2.3
├── tracing-core v0.1.10 ()
├── tracing-log v0.1.1
│ └── tracing-core v0.1.10 (
)
└── tracing-serde v0.1.1
└── tracing-core v0.1.10 (*)

Platform

Linux elysium 5.5.6-arch1-1 #1 SMP PREEMPT Mon, 24 Feb 2020 12:20:16 +0000 x86_64 GNU/Linux

Crates

tracing
tracing-subscriber

Description

When repeatedly record()ing values to the same span key, a space between each KV pair is missing.
MVP:

use {
    tracing::{info, info_span},
    tracing_subscriber::FmtSubscriber,
};

fn main() {
    let subscriber = FmtSubscriber::builder().finish();
    tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed");

    let span = info_span!("debug", happy = true);
    let _grd = span.enter();
    span.record("happy", &false);

    info!("hello world");
}

The expected result: <DATE> INFO debug{happy=true happy=false}: <FILE>: hello world

The actual output: <DATE> INFO debug{happy=truehappy=false}: <FILE>: hello world

Note the lack of a space between 'true' and 'happy'

Metadata

Metadata

Assignees

No one assigned

    Labels

    crate/subscriberRelated to the `tracing-subscriber` crategood first issueGood for newcomerskind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions