From b0a8f344c2ff24937976a34832ac6227eed5e76a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 4 Aug 2021 01:43:35 +0100 Subject: [PATCH] client logger config Signed-off-by: Ian Jackson --- src/bin/client.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/bin/client.rs b/src/bin/client.rs index 89857d5..12a3284 100644 --- a/src/bin/client.rs +++ b/src/bin/client.rs @@ -291,7 +291,16 @@ async fn main() -> Result<(), AE> { let ics = config::read(&opts.config, LinkEnd::Client)?; if ics.is_empty() { throw!(anyhow!("no associations with server(s)")); } - env_logger::init(); + { + let env = env_logger::Env::new() + .filter("HIPPOTAT_LOG") + .write_style("HIPPOTAT_LOG_STYLE"); + + let mut logb = env_logger::Builder::new(); + logb.filter(Some("hippotat"), log::LevelFilter::Info); + logb.parse_env(env); + logb.init(); + } let https = HttpsConnector::new(); let hclient = hyper::Client::builder().build::<_, hyper::Body>(https); -- 2.30.2