aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/mod_management
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-05-17 16:47:00 +0200
committerGitHub <noreply@github.com>2023-05-17 16:47:00 +0200
commit76f621a8454389ffbe1a6fe7fada0deeebf2f757 (patch)
treea3f57d757e87765e0511607cdf2f55819bee7a2f /src-tauri/src/mod_management
parent9746cdeb47b226087ced574cddaac829b995e79b (diff)
downloadFlightCore-76f621a8454389ffbe1a6fe7fada0deeebf2f757.tar.gz
FlightCore-76f621a8454389ffbe1a6fe7fada0deeebf2f757.zip
feat: Better logging regarding mod installation (#363)
* fix: Make log comment more specific * feat: Log attempting to create temp dir * feat: Log mod to install and GameInstall struct * refactor: Replace `dbg` with proper logging * refactor: Replace `dbg` with proper logging * feat: Warning log mod install error * style: Fix formatting * feat: Log libthermite error and modstring when mod install fails
Diffstat (limited to 'src-tauri/src/mod_management')
-rw-r--r--src-tauri/src/mod_management/mod.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs
index 455aa424..43464c8f 100644
--- a/src-tauri/src/mod_management/mod.rs
+++ b/src-tauri/src/mod_management/mod.rs
@@ -340,7 +340,7 @@ async fn get_ns_mod_download_url(thunderstore_mod_string: &str) -> Result<String
/// Returns a vector of modstrings containing the dependencies of a given mod
async fn get_mod_dependencies(thunderstore_mod_string: &str) -> Result<Vec<String>, anyhow::Error> {
- dbg!(thunderstore_mod_string);
+ log::info!("Attempting to get dependencies for: {thunderstore_mod_string}");
// TODO: This will crash the thread if not internet connection exist. `match` should be used instead
let index = thermite::api::get_package_index().unwrap().to_vec();
@@ -369,6 +369,7 @@ pub async fn fc_download_mod_and_install(
game_install: &GameInstall,
thunderstore_mod_string: &str,
) -> Result<(), String> {
+ log::info!("Attempting to install \"{thunderstore_mod_string}\" to {game_install:?}");
// Get mods and download directories
let download_directory = format!(
"{}/___flightcore-temp-download-dir/",
@@ -385,7 +386,7 @@ pub async fn fc_download_mod_and_install(
Ok(deps) => deps,
Err(err) => return Err(err.to_string()),
};
- dbg!(deps.clone());
+ log::info!("Mod dependencies: {deps:?}");
// Recursively install dependencies
for dep in deps {
@@ -439,7 +440,10 @@ pub async fn fc_download_mod_and_install(
std::path::Path::new(&mods_directory),
) {
Ok(()) => (),
- Err(err) => return Err(err.to_string()),
+ Err(err) => {
+ log::warn!("libthermite couldn't install mod {thunderstore_mod_string} due to {err:?}",);
+ return Err(err.to_string());
+ }
};
Ok(())