A vaguely related option would be to set the level in the loggingmodule of the Python standard library, and I quote from Python docs:
import logging
LOG_FILENAME = 'example.log'
logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)
logging.debug('This message should go to the log file')
, level= , . ( ), logging, (, ), - ; ( , , ), - sys.excepthook, - ( , - , - , ).