summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2025-01-14 20:38:26 -0600
committerLibravatar bigfoot547 <[email protected]>2025-01-14 20:38:26 -0600
commitb833fbff8e24b56a1587b0115ee4332627d38ec2 (patch)
tree85349165b33339c0eb33c0e13a783cbcb26f02c4 /src
parentadd logger config stuffs (diff)
fix stuff
Diffstat (limited to 'src')
-rw-r--r--src/launcher.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/launcher.rs b/src/launcher.rs
index 03b289d..96ba3bd 100644
--- a/src/launcher.rs
+++ b/src/launcher.rs
@@ -244,6 +244,8 @@ impl Launcher {
path.push(filename);
+ debug!("Logger config {} is at {}", id, path.display());
+
// creates the JVM argument for this logger config
fn get_arg(arg: &str, path: &Path) -> String {
strsub::replace_str(arg, |key| match key {
@@ -255,7 +257,10 @@ impl Launcher {
// verify the file
match util::verify_file(path.as_path(), dlinfo.size, dlinfo.sha1).await {
// integrity passed. return
- Ok(_) => return Ok(Some(get_arg(config.client.argument.as_str(), path.as_path()))),
+ Ok(_) => {
+ info!("Log configuration {} exists and integrity matches. Skipping.", id);
+ return Ok(Some(get_arg(config.client.argument.as_str(), path.as_path())));
+ },
// ruh roh
Err(e) => match e {
@@ -283,6 +288,8 @@ impl Launcher {
error: e
})?;
+ debug!("Logger configuration {} must be downloaded ({}).", id, url);
+
let mut response = reqwest::get(url).await.map_err(|e| LogConfigError::Download{ url: url.to_owned(), error: e })?;
let mut tally = 0usize;
let mut sha1 = Sha1::new();
@@ -302,6 +309,7 @@ impl Launcher {
drop(file); // manually close file
let del_file_silent = || async {
+ debug!("Deleting downloaded log config {} since its integrity doesn't match :( {}", id, path.display());
let _ = fs::remove_file(path.as_path()).await.map_err(|e| warn!("failed to delete invalid log config: {}", e));
()
};
@@ -326,6 +334,8 @@ impl Launcher {
}));
}
+ info!("Log configuration {} downloaded successfully.", id);
+
Ok(Some(get_arg(config.client.argument.as_str(), path.as_path())))
}
@@ -414,6 +424,8 @@ impl Launcher {
} else {
log_arg = None;
}
+
+ dbg!(log_arg);
//todo!()
Ok(())