def setup_log_file_handler(config, logfile, fmt):
 log_file_path = os.path.join(config.logs_dir, logfile)
 try:
  handler = logging.handlers.RotatingFileHandler(log_file_path, maxBytes=(2 ** 20), backupCount=1000)
 except IOError as error:
  raise errors.Error(_PERM_ERR_FMT.format(error))
 handler.doRollover()
 handler.setLevel(logging.DEBUG)
 handler_formatter = logging.Formatter(fmt=fmt)
 handler_formatter.converter = time.gmtime
 handler.setFormatter(handler_formatter)
 return (handler, log_file_path)

def setup_log_file_handler ( config , logfile , fmt ) : log_file_path = os . path . join ( config . logs_dir , logfile ) try : handler = logging . handlers . RotatingFileHandler ( log_file_path , maxBytes = ( 2 ** 20 ) , backupCount = 1000 ) except IOError as error : raise errors . Error ( _PERM_ERR_FMT . format ( error ) ) handler . doRollover ( ) handler . setLevel ( logging . DEBUG ) handler_formatter = logging . Formatter ( fmt = fmt ) handler_formatter . converter = time . gmtime handler . setFormatter ( handler_formatter ) return ( handler , log_file_path )
setup file debug logging .