def log_cef(name, severity, env, *args, **kwargs):
 c = {'cef.product': getattr(settings, 'CEF_PRODUCT', 'AMO'), 'cef.vendor': getattr(settings, 'CEF_VENDOR', 'Mozilla'), 'cef.version': getattr(settings, 'CEF_VERSION', '0'), 'cef.device_version': getattr(settings, 'CEF_DEVICE_VERSION', '0'), 'cef.file': getattr(settings, 'CEF_FILE', 'syslog')}
 if isinstance(env, HttpRequest):
  r = env.META.copy()
  if ('PATH_INFO' in r):
   r['PATH_INFO'] = env.build_absolute_uri(r['PATH_INFO'])
 elif isinstance(env, dict):
  r = env
 else:
  r = {}
 if settings.USE_HEKA_FOR_CEF:
  return settings.HEKA.cef(name, severity, r, config=c, *args, **kwargs)
 else:
  return _log_cef(name, severity, r, config=c, *args, **kwargs)

def log_cef ( name , severity , env , * args , ** kwargs ) : c = { 'cef.product' : getattr ( settings , 'CEF_PRODUCT' , 'AMO' ) , 'cef.vendor' : getattr ( settings , 'CEF_VENDOR' , 'Mozilla' ) , 'cef.version' : getattr ( settings , 'CEF_VERSION' , '0' ) , 'cef.device_version' : getattr ( settings , 'CEF_DEVICE_VERSION' , '0' ) , 'cef.file' : getattr ( settings , 'CEF_FILE' , 'syslog' ) } if isinstance ( env , HttpRequest ) : r = env . META . copy ( ) if ( 'PATH_INFO' in r ) : r [ 'PATH_INFO' ] = env . build_absolute_uri ( r [ 'PATH_INFO' ] ) elif isinstance ( env , dict ) : r = env else : r = { } if settings . USE_HEKA_FOR_CEF : return settings . HEKA . cef ( name , severity , r , config = c , * args , ** kwargs ) else : return _log_cef ( name , severity , r , config = c , * args , ** kwargs )
simply wraps the cef_log function so we dont need to pass in the config dictionary every time .