From 054b9a505caa117af933cb0930b9eb46909b8d95 Mon Sep 17 00:00:00 2001 From: Henrik Gustafsson Date: Wed, 15 Nov 2023 15:15:00 +0000 Subject: [PATCH] Default to using `StdoutLock` for writing --- tracing-logstash/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tracing-logstash/src/lib.rs b/tracing-logstash/src/lib.rs index 9160f78..08be1e5 100644 --- a/tracing-logstash/src/lib.rs +++ b/tracing-logstash/src/lib.rs @@ -14,7 +14,7 @@ use tracing_subscriber::fmt::MakeWriter; use tracing_subscriber::layer::Context; use tracing_subscriber::registry::LookupSpan; -pub struct Layer std::io::Stdout> { +pub struct Layer std::io::StdoutLock<'static>> { record_separator: Vec, make_writer: W, event_format: E, @@ -25,7 +25,7 @@ impl Default for Layer { fn default() -> Self { Self { record_separator: vec![b'\n'], - make_writer: std::io::stdout, + make_writer: || std::io::stdout().lock(), event_format: Default::default(), _inner: Default::default(), }