Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from logging_helper import setup_logger, log_exception
- # Setup the logger
- logger = setup_logger(r"C:\Scripts\Archive.ph Link Saver\Logs\Past Tracebacks.log")
- try:
- # Code that might raise an exception
- with open(r"C:\Scripts\Archivsdsdse.ph Link Checker\Resources\Data\sdsdNew URLs.txt", "r") as input_file:
- file_data = input_file.read().rstrip('\n')
- except Exception as e:
- print("Exception caught: ", e) # Debug print to confirm exception block is reached.
- log_exception(type(e), e, e.__traceback__, logger)
- print("Logging complete") # Debug print to confirm the logging function was called
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement