Configuring different debug output levels

In this recipe, we will configure different debug levels, which we can select and change at runtime. This allows us to control how much we want to drill down into our code when debugging our code.

We will create two new Python classes and place both of them into the same module.

We will use four different logging levels and write our debugging output to a log file we will create. If the logs folder does not exist, we will create it automatically as well.

The name of the log file is the name of the executing script, which is our refactored GUI.py. We can also choose other names for our log files by passing in the full path to the initializer of our Logger class.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.136.119