Advertisement
Jexal

67acefa5-b7cc-4ef2-b830-eb193967cf06

Jan 22nd, 2025
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. from logging_helper import setup_logger, log_exception
  2.  
  3. # Setup the logger
  4. logger = setup_logger(r"C:\Scripts\Archive.ph Link Saver\Logs\Past Tracebacks.log")
  5.  
  6. try:
  7.     # Code that might raise an exception
  8.     with open(r"C:\Scripts\Archivsdsdse.ph Link Checker\Resources\Data\sdsdNew URLs.txt", "r") as input_file:
  9.         file_data = input_file.read().rstrip('\n')
  10. except Exception as e:
  11.     print("Exception caught: ", e)  # Debug print to confirm exception block is reached.
  12.     log_exception(type(e), e, e.__traceback__, logger)
  13.     print("Logging complete")  # Debug print to confirm the logging function was called
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement