From: Ian Jackson Date: Wed, 4 Aug 2021 00:43:35 +0000 (+0100) Subject: client logger config X-Git-Tag: hippotat/1.0.0~353 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=b0a8f344c2ff24937976a34832ac6227eed5e76a;p=hippotat.git client logger config Signed-off-by: Ian Jackson --- 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);