def add_stderr_logger(level=logging.DEBUG):
 logger = logging.getLogger(__name__)
 handler = logging.StreamHandler()
 handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s'))
 logger.addHandler(handler)
 logger.setLevel(level)
 logger.debug(('Added a stderr logging handler to logger: %s' % __name__))
 return handler

def add_stderr_logger ( level = logging . DEBUG ) : logger = logging . getLogger ( __name__ ) handler = logging . StreamHandler ( ) handler . setFormatter ( logging . Formatter ( '%(asctime)s %(levelname)s %(message)s' ) ) logger . addHandler ( handler ) logger . setLevel ( level ) logger . debug ( ( 'Added a stderr logging handler to logger: %s' % __name__ ) ) return handler
helper for quickly adding a streamhandler to the logger .