From 43b6baeb57b903d1311e9b9c3a66ef474903cb1b Mon Sep 17 00:00:00 2001 From: Rajat Arya Date: Mon, 9 Dec 2024 09:58:47 -0800 Subject: [PATCH] Make log level compilation flag (#109) - debug build will have INFO as default log level - release build will have WARN as default log level --- hf_xet/src/log.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hf_xet/src/log.rs b/hf_xet/src/log.rs index 1d0bb376..5552ae3a 100644 --- a/hf_xet/src/log.rs +++ b/hf_xet/src/log.rs @@ -9,6 +9,11 @@ use utils::ThreadPool; use crate::log_buffer::{get_telemetry_task, LogBufferLayer, TELEMETRY_PRE_ALLOC_BYTES}; +/// Default log level for the library to use. Override using `RUST_LOG` env variable. +#[cfg(not(debug_assertions))] +const DEFAULT_LOG_LEVEL: &str = "warn"; + +#[cfg(debug_assertions)] const DEFAULT_LOG_LEVEL: &str = "info"; pub fn initialize_logging(threadpool: Arc) {