From 1cfad254e0c4507c96e80605058373c9df19328a Mon Sep 17 00:00:00 2001 From: Jonathan Strong Date: Sat, 12 May 2018 04:24:12 -0400 Subject: [PATCH] sets huge channel buffer for async logger when trace is enabled --- src/lib.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 17760fd..ceb5e8e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -46,13 +46,16 @@ pub mod latency; pub mod hist; #[cfg(feature = "trace")] -pub const LOG_LEVEL : Severity = Severity::Trace; +pub const LOG_LEVEL: Severity = Severity::Trace; #[cfg(all(feature = "debug", not(feature = "trace")))] -pub const LOG_LEVEL : Severity = Severity::Debug; +pub const LOG_LEVEL: Severity = Severity::Debug; #[cfg(not(any(feature = "debug", feature = "trace")))] -pub const LOG_LEVEL : Severity = Severity::Info; +pub const LOG_LEVEL: Severity = Severity::Info; -const CHANNEL_SIZE: usize = 20_000; +#[cfg(not(feature = "trace"))] +const CHANNEL_SIZE: usize = 32_768; +#[cfg(feature = "trace")] +const CHANNEL_SIZE: usize = 2_097_152; /// converts a chrono::DateTime to an integer timestamp (ns) ///