From 7bdd2118a227b087c9ab1edc5fb790910307e1b0 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 9 Jan 2024 03:32:01 -0800 Subject: [PATCH] Change some log messages when deleting files --- modules/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/utils.py b/modules/utils.py index 50bf3a7c..de6d32dc 100644 --- a/modules/utils.py +++ b/modules/utils.py @@ -25,13 +25,13 @@ def save_file(fname, contents): rel_path_str = os.path.relpath(abs_path_str, root_folder) rel_path = Path(rel_path_str) if rel_path.parts[0] == '..': - logger.error(f'Invalid file path: {fname}') + logger.error(f'Invalid file path: \"{fname}\"') return with open(abs_path_str, 'w', encoding='utf-8') as f: f.write(contents) - logger.info(f'Saved {abs_path_str}.') + logger.info(f'Saved \"{abs_path_str}\".') def delete_file(fname): @@ -44,12 +44,12 @@ def delete_file(fname): rel_path_str = os.path.relpath(abs_path_str, root_folder) rel_path = Path(rel_path_str) if rel_path.parts[0] == '..': - logger.error(f'Invalid file path: {fname}') + logger.error(f'Invalid file path: \"{fname}\"') return if rel_path.exists(): rel_path.unlink() - logger.info(f'Deleted {fname}.') + logger.info(f'Deleted \"{fname}\".') def current_time():