From b210782af0c39d62ea576287027fa0929e101671 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 10 Nov 2023 17:25:53 -0500 Subject: [PATCH] Don't use println --- src/bootdata.rs | 3 ++- src/gamedata.rs | 6 +++--- src/patch.rs | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/bootdata.rs b/src/bootdata.rs index b75f5ae..3d9790f 100755 --- a/src/bootdata.rs +++ b/src/bootdata.rs @@ -3,6 +3,7 @@ use std::fs; use std::path::PathBuf; +use tracing::warn; use crate::patch::{apply_patch, PatchError}; @@ -44,7 +45,7 @@ impl BootData { version: fs::read_to_string(format!("{directory}/ffxivboot.ver")).unwrap(), }), false => { - println!("Boot data is not valid!"); + warn!("Boot data is not valid!"); None } } diff --git a/src/gamedata.rs b/src/gamedata.rs index 2018ff3..30db77b 100755 --- a/src/gamedata.rs +++ b/src/gamedata.rs @@ -6,7 +6,7 @@ use std::fs; use std::fs::{DirEntry, ReadDir}; use std::path::PathBuf; -use tracing::debug; +use tracing::{debug, warn}; use crate::common::{Language, read_version}; use crate::dat::DatFile; @@ -34,7 +34,7 @@ fn is_valid(path: &str) -> bool { let d = PathBuf::from(path); if fs::metadata(d.as_path()).is_err() { - println!("Failed game directory."); + warn!("Game directory not found."); return false; } @@ -76,7 +76,7 @@ impl GameData { index_files: HashMap::new() }), false => { - println!("Game data is not valid!"); + warn!("Game data is not valid!"); None } } diff --git a/src/patch.rs b/src/patch.rs index c3f215e..c6e5ea9 100755 --- a/src/patch.rs +++ b/src/patch.rs @@ -10,6 +10,7 @@ use std::path::PathBuf; use binrw::binread; use binrw::BinRead; use binrw::binrw; +use tracing::debug; use crate::common::Region; use crate::sqpack::read_data_block_patch; @@ -620,10 +621,10 @@ pub fn apply_patch(data_dir: &str, patch_path: &str) -> Result<(), PatchError> { // Currently, IgnoreMissing and IgnoreOldMismatch is not used in XIVQuickLauncher either. This stays as an intentional NOP. } ChunkType::AddDirectory(_) => { - println!("PATCH: NOP AddDirectory"); + debug!("PATCH: NOP AddDirectory"); } ChunkType::DeleteDirectory(_) => { - println!("PATCH: NOP DeleteDirectory"); + debug!("PATCH: NOP DeleteDirectory"); } ChunkType::EndOfFile => { return Ok(());