Skip to content

Commit

Permalink
updated logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jooleer committed May 17, 2023
1 parent ad14b7c commit 063e386
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions folder_hash_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def main():
log_name = str(time.time())
logging.basicConfig(filename="logs/log_"+log_name+".txt", level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s', datefmt='%H:%M:%S')
print(f"Log file: logs/log_{log_name}.txt\n")
logging.info(f"[SETTINGS] -p {args.primary} -s {args.secondary} -a {args.algorithm} -d {args.disable} -m {args.missing} -n {args.nmissing} -v {args.verbose} -l {args.logging} -c {args.custom}\n")
logging.info(f"[SETTINGS] -p {args.primary} -s {args.secondary} -a {args.algorithm} -d {args.disable} -m {args.missing} -n {args.nmissing} -v {args.verbose} -l {not args.logging} -c {args.custom}")
logging.info(f"Comparing {primary_directory} against {secondary_directory}\n")

f1_amount = get_files_amount(primary_directory)
f2_amount = get_files_amount(secondary_directory)
Expand Down Expand Up @@ -180,10 +181,11 @@ def main():
+ bcolors.FAIL + f"\n{files_errors} file(s) FAILED" + bcolors.ENDC
+ bcolors.WARNING + f"\n{files_missing_total} file(s) MISSING" + bcolors.ENDC)

logging.info(f"Processed {files_amount} file(s): ")
logging.info(f"{files_completed} file(s) OK")
logging.info(f"{files_errors} file(s) FAILED")
logging.info(f"{files_missing_total} file(s) MISSING")
if(not args.logging):
logging.info(f"Processed {files_amount} file(s): ")
logging.info(f"{files_completed} file(s) OK")
logging.info(f"{files_errors} file(s) FAILED")
logging.info(f"{files_missing_total} file(s) MISSING")


if __name__ == '__main__':
Expand Down Expand Up @@ -215,7 +217,6 @@ def main():

if(args.verbose):
print(f"Comparing:\n{primary_directory}\nagainst:\n{secondary_directory}\n")
logging.info(f"Comparing: {primary_directory} against: {secondary_directory}")

# hash algorithm (CRC32, MD5, SHA256)
if(not args.algorithm):
Expand Down

0 comments on commit 063e386

Please sign in to comment.