fix console output in var::load_prefs (bevy macros dont work here)
This commit is contained in:
parent
e579fdcdb7
commit
4ed006c548
12
src/var.rs
12
src/var.rs
|
@ -472,13 +472,13 @@ pub fn load_prefs() -> Preferences {
|
||||||
match toml {
|
match toml {
|
||||||
Ok(toml) => (toml, Some(path)),
|
Ok(toml) => (toml, Some(path)),
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
error!("Failed to open preferences file '{path}': {error}");
|
eprintln!("Error: Failed to open preferences file '{path}': {error}");
|
||||||
return Preferences::default();
|
return Preferences::default();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None => {
|
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)
|
(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(doc) => match toml_edit::de::from_document::<Preferences>(doc) {
|
||||||
Ok(mut pref) => {
|
Ok(mut pref) => {
|
||||||
if let Some(path) = &path {
|
if let Some(path) = &path {
|
||||||
info!("Loaded preference file from {path}");
|
println!("Loaded preference file from {path}");
|
||||||
} else {
|
} else {
|
||||||
info!("Loaded preferences from internal defaults");
|
println!("Loaded preferences from internal defaults");
|
||||||
}
|
}
|
||||||
pref.source_file = path;
|
pref.source_file = path;
|
||||||
dbg!(&pref);
|
dbg!(&pref);
|
||||||
return pref;
|
return pref;
|
||||||
}
|
}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
error!("Failed to read preference line: {error}");
|
eprintln!("Error: Failed to read preference line: {error}");
|
||||||
return Preferences::default();
|
return Preferences::default();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
error!("Failed to open preferences: {error}");
|
eprintln!("Error: Failed to open preferences: {error}");
|
||||||
return Preferences::default();
|
return Preferences::default();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue