diff options
author | David Knaack <davidkna@users.noreply.github.com> | 2020-12-13 16:24:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-13 16:24:48 +0100 |
commit | 60be453797e7e3971ae69fdb71e38f63a77e21bc (patch) | |
tree | a62afa39fc5a923d7c6e1f758ef9a427e0f4cd81 | |
parent | f311c3cbf5f5a79b59bcb6a2bb546c47035621af (diff) |
fix(config): log as error if failure to read config wasn't caused by NotFound (#1993)
-rw-r--r-- | src/config.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs index a210f52e8..211d93632 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 } }?; |