aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/main.rs
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-03-26 14:25:58 +0200
committerGitHub <noreply@github.com>2023-03-26 12:25:58 +0000
commitfe3cb8202f4332a547c15c1e9fb46eb2a5f7a470 (patch)
tree75e2d95334ab39a66e6c6cf4107f59136ab6dcbb /src-tauri/src/main.rs
parent91c1dbb72943d00eefb5564ee85671f57a349709 (diff)
downloadFlightCore-fe3cb8202f4332a547c15c1e9fb46eb2a5f7a470.tar.gz
FlightCore-fe3cb8202f4332a547c15c1e9fb46eb2a5f7a470.zip
refactor: Replace all `println!()` with log statements (#236)
* refactor: Replace all println with calls to logger in `do_install()` * refactor: Replace all println with calls to logger in `verify_install_location()` * refactor: Replace all println with calls to logger in `get_northstar_release_notes()` * refactor: Replace all println with calls to logger in `update_northstar_caller()` * refactor: Replace all println with calls to logger in `install_northstar_caller()` * refactor: Replace all println with calls to logger in `apply_launcher_pr()` * refactor: Replace all println with calls to logger in `apply_mods_pr()` * refactor: Replace all println with calls to logger in `find_game_install_location()` * refactor: Replace all println with calls to logger in `install_mod_caller()` * refactor: Replace all println with calls to logger in `set_mod_enabled_status()` * refactor: Replace all println with calls to logger in `parse_installed_mods()` * refactor: Replace all println with calls to logger in `origin_install_location_detection()` * refactor: Replace all println with calls to logger in `query_thunderstore_packages_api()` * refactor: Replace all println with calls to logger in `add_batch_file()` * refactor: Replace all println with calls to logger in `extract()` * refactor: Replace all println with calls to logger in `check_is_northstar_outdated()`
Diffstat (limited to 'src-tauri/src/main.rs')
-rw-r--r--src-tauri/src/main.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index d5fef9cb..4d03e967 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -234,7 +234,7 @@ async fn check_is_northstar_outdated(
let version_number = match get_northstar_version_number(game_path) {
Ok(version_number) => version_number,
Err(err) => {
- println!("{}", err);
+ log::warn!("{}", err);
// If we fail to get new version just assume we are up-to-date
return Err(err.to_string());
}
@@ -266,7 +266,7 @@ async fn verify_install_location(game_path: String) -> bool {
match check_is_valid_game_path(&game_path) {
Ok(()) => true,
Err(err) => {
- println!("{}", err);
+ log::warn!("{}", err);
false
}
}
@@ -284,11 +284,11 @@ async fn install_northstar_caller(
game_path: String,
northstar_package_name: Option<String>,
) -> Result<bool, String> {
- println!("Running");
+ log::info!("Running");
match install_northstar(&game_path, northstar_package_name).await {
Ok(_) => Ok(true),
Err(err) => {
- println!("{}", err);
+ log::error!("{}", err);
Err(err.to_string())
}
}
@@ -300,13 +300,13 @@ async fn update_northstar_caller(
game_path: String,
northstar_package_name: Option<String>,
) -> Result<bool, String> {
- println!("Updating");
+ log::info!("Updating Northstar");
// Simply re-run install with up-to-date version for upate
match install_northstar(&game_path, northstar_package_name).await {
Ok(_) => Ok(true),
Err(err) => {
- println!("{}", err);
+ log::error!("{}", err);
Err(err.to_string())
}
}
@@ -331,7 +331,7 @@ async fn install_mod_caller(
match clean_up_download_folder(game_install, false) {
Ok(()) => Ok(()),
Err(err) => {
- println!("Failed to delete download folder due to {}", err);
+ log::info!("Failed to delete download folder due to {}", err);
// Failure to delete download folder is not an error in mod install
// As such ignore. User can still force delete if need be
Ok(())