i would enclose all the code here in a test:

    if self.cfg.log_level == 'debug': 

Or something like it, so normal exit will be faster.