def common_log(environ, response, response_time=None):
 logger = logging.getLogger()
 logger.setLevel(logging.INFO)
 if response_time:
  formatter = ApacheFormatter(with_response_time=True)
  try:
   log_entry = formatter(response.status_code, environ, len(response.content), rt_us=response_time)
  except TypeError:
   log_entry = formatter(response.status_code, environ, len(response.content), rt_ms=response_time)
 else:
  formatter = ApacheFormatter(with_response_time=False)
  log_entry = formatter(response.status_code, environ, len(response.content))
 logger.info(log_entry)
 return log_entry

def common_log ( environ , response , response_time = None ) : logger = logging . getLogger ( ) logger . setLevel ( logging . INFO ) if response_time : formatter = ApacheFormatter ( with_response_time = True ) try : log_entry = formatter ( response . status_code , environ , len ( response . content ) , rt_us = response_time ) except TypeError : log_entry = formatter ( response . status_code , environ , len ( response . content ) , rt_ms = response_time ) else : formatter = ApacheFormatter ( with_response_time = False ) log_entry = formatter ( response . status_code , environ , len ( response . content ) ) logger . info ( log_entry ) return log_entry
given the wsgi environ and the response .