fix console output in var::load_prefs (bevy macros dont work here)

This commit is contained in:
yuni 2024-06-13 00:04:24 +02:00
parent e579fdcdb7
commit 4ed006c548

View file

@ -472,13 +472,13 @@ pub fn load_prefs() -> Preferences {
match toml {
Ok(toml) => (toml, Some(path)),
Err(error) => {
error!("Failed to open preferences file '{path}': {error}");
eprintln!("Error: Failed to open preferences file '{path}': {error}");
return Preferences::default();
}
}
}
None => {
warn!("Found no preference file, using default preferences.");
println!("Found no preference file, using default preferences.");
(include_str!("data/outfly.toml").to_string(), None)
}
};
@ -486,21 +486,21 @@ pub fn load_prefs() -> Preferences {
Ok(doc) => match toml_edit::de::from_document::<Preferences>(doc) {
Ok(mut pref) => {
if let Some(path) = &path {
info!("Loaded preference file from {path}");
println!("Loaded preference file from {path}");
} else {
info!("Loaded preferences from internal defaults");
println!("Loaded preferences from internal defaults");
}
pref.source_file = path;
dbg!(&pref);
return pref;
}
Err(error) => {
error!("Failed to read preference line: {error}");
eprintln!("Error: Failed to read preference line: {error}");
return Preferences::default();
}
},
Err(error) => {
error!("Failed to open preferences: {error}");
eprintln!("Error: Failed to open preferences: {error}");
return Preferences::default();
}
}