]> piware.de Git - learn-rust.git/commitdiff
serde: Show ≥ info logs by default
authorMartin Pitt <martin@piware.de>
Sun, 26 Sep 2021 08:47:26 +0000 (10:47 +0200)
committerMartin Pitt <martin@piware.de>
Sun, 26 Sep 2021 08:47:28 +0000 (10:47 +0200)
serde/src/main.rs

index fc88d23c418c5872db2d7df475506038a1644949..cdc7c81259b5aa4b177fbf2cb8197d7b78b30fc6 100644 (file)
@@ -44,9 +44,9 @@ fn load_contacts() -> Result<Contacts, Box<dyn Error>> {
 }
 
 fn main() -> Result<(), Box<dyn Error>> {
-    env_logger::init();
+    env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init();
     create_contacts()?;
     let contacts = load_contacts()?;
-    println!("deserialized: {:?}", &contacts);
+    log::info!("deserialized: {:?}", &contacts);
     Ok(())
 }