Again, there is misunderstanding - the fact that you have set a logger, DOES NOT mean that it will catch/handle automatically any error.
Error handling and logging are two different things.
the fact that you set this particular WatchedFileHandler handler to DEBUG level means that any logging will be done to this handler (because it will handle DEBUG level and above). Imagine you have another handler (e.g. console handler) set to different level, e.g. info, in which case it will handle any logs at level INFO and above, but not DEBUG - i.e. DEBUG level will be written in the file, but not to console.
Again, having a logger is NOT error handling (although you will certainly write to log if you get error). You can handle the errors, without logging them/anything and also you can have a logger and not handle any error (like you do in your code).
read https://docs.python.org/3/tutorial/errors.html and https://realpython.com/python-exceptions/
Error handling and logging are two different things.
the fact that you set this particular WatchedFileHandler handler to DEBUG level means that any logging will be done to this handler (because it will handle DEBUG level and above). Imagine you have another handler (e.g. console handler) set to different level, e.g. info, in which case it will handle any logs at level INFO and above, but not DEBUG - i.e. DEBUG level will be written in the file, but not to console.
Again, having a logger is NOT error handling (although you will certainly write to log if you get error). You can handle the errors, without logging them/anything and also you can have a logger and not handle any error (like you do in your code).
read https://docs.python.org/3/tutorial/errors.html and https://realpython.com/python-exceptions/
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs