1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-12-26 11:37:32 +00:00

refactor(config): Add additional logging to debug config issues (#1390)

This commit is contained in:
Thomas O'Donnell 2020-06-24 22:11:05 +02:00 committed by GitHub
parent 2cc2469cfe
commit dbe6bdf031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,9 +221,16 @@ impl StarshipConfig {
}
}?;
let config = toml::from_str(&toml_content).ok()?;
log::debug!("Config parsed: \n{:?}", &config);
Some(config)
match toml::from_str(&toml_content) {
Ok(parsed) => {
log::debug!("Config parsed: \n{:?}", &parsed);
Some(parsed)
}
Err(error) => {
log::debug!("Unable to parse the config file: {}", error);
None
}
}
}
/// Get the subset of the table for a module by its name