Skip to content

Commit

Permalink
Changing logging output
Browse files Browse the repository at this point in the history
  • Loading branch information
NeffIsBack committed Dec 19, 2024
1 parent af512f1 commit 930f045
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nxc/modules/snipped.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ def on_admin_login(self, context, connection):
connection.conn.getFile(self.share, remote_file_path, local_file.write)

if not exists(local_file_path):
context.log.error(f"Downloaded file {local_file_path} does not exist.")
context.log.fail(f"Downloaded file '{local_file_path}' does not exist.")
continue

file_size = getsize(local_file_path)
if file_size == 0:
context.log.error(f"Downloaded file {local_file_path} is 0 bytes. Skipping.")
context.log.fail(f"Downloaded file '{local_file_path}' is 0 bytes. Skipping.")
os.remove(local_file_path)
else:
total_files_downloaded += 1
except Exception as e:
context.log.debug(f"Failed to download {remote_file_path} for user {folder_name}: {e}")
context.log.debug(f"Failed to download '{remote_file_path}' for user {folder_name}: {e}")

if total_files_downloaded > 0 and host_output_path:
context.log.success(f"{total_files_downloaded} file(s) downloaded from host {connection.host} to {host_output_path}.")
Expand Down

0 comments on commit 930f045

Please sign in to comment.