From 60be453797e7e3971ae69fdb71e38f63a77e21bc Mon Sep 17 00:00:00 2001 From: David Knaack Date: Sun, 13 Dec 2020 16:24:48 +0100 Subject: [PATCH] fix(config): log as error if failure to read config wasn't caused by NotFound (#1993) --- src/config.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index a210f52e..211d9363 100644 --- a/src/config.rs +++ b/src/config.rs @@ -5,6 +5,7 @@ use indexmap::IndexMap; use std::clone::Clone; use std::collections::HashMap; +use std::io::ErrorKind; use std::marker::Sized; use std::env; @@ -236,7 +237,13 @@ impl StarshipConfig { Some(content) } Err(e) => { - log::debug!("Unable to read config file content: {}", &e); + let level = if e.kind() == ErrorKind::NotFound { + log::Level::Debug + } else { + log::Level::Error + }; + + log::log!(level, "Unable to read config file content: {}", &e); None } }?;