O'Reilly logo

Python GUI Programming Cookbook by Burkhard A. Meier

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring different debug output levels

In this recipe, we will configure different debug levels that 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 we will write our debugging output to a log file we will create. If the log 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.

Getting ready

We will continue to use our ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required