#NEWLINE# def log_cef( name , severity = logging . INFO , env = None , username = 'none' , signature = None , **kwargs ) : #NEWLINE# #INDENT# "\n    Wraps cef logging function so we don't need to pass in the config\n    dictionary every time. See bug 707060. ``env`` can be either a request\n    object or just the request.META dictionary.\n    " #NEWLINE# cef_logger = commonware . log . getLogger ( 'cef' ) #NEWLINE# c = { #NEWLINE# #INDENT# 'product' : settings . CEF_PRODUCT , #NEWLINE# 'vendor' : settings . CEF_VENDOR , #NEWLINE# 'version' : settings . CEF_VERSION , #NEWLINE# 'device_version' : settings . CEF_DEVICE_VERSION , #NEWLINE# #UNINDENT# } #NEWLINE# if isinstance ( env , HttpRequest ) : #NEWLINE# #INDENT# r = env . META . copy ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( env , dict ) : #NEWLINE# #INDENT# r = env #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# r = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# #UNINDENT# c [ 'environ' ] = r #NEWLINE# c . update ( { #NEWLINE# #INDENT# 'username' : username , #NEWLINE# 'signature' : signature , #NEWLINE# 'data' : kwargs , #NEWLINE# #UNINDENT# } ) #NEWLINE# cef_logger . log ( cef_logger , name , c )