Ejemplo n.º 1
0
    def _process_exception(self,
                           exception,
                           exR,
                           close_name=my_settings.REQ_LOG_NAME):
        #save head exception information
        def_exc_log = arr_lambda_by_name(my_settings.EXCEPTION_FIELDS,
                                         exception_fields)
        glog.err([my_settings.EXCEPTION_TOP_NAME] +
                 arr_funcs_call(def_exc_log, exception))

        #save frames info
        def_exc_log = arr_lambda_by_name(my_settings.EXCEPTION_STACK_FIELDS,
                                         exception_fields)
        frames = exR.get_traceback_frames()
        frames.reverse()
        for frame in frames:
            glog.err([my_settings.EXCEPTION_MIDDLE_NAME] +
                     arr_funcs_call(def_exc_log, frame, exR))

        #save close info
        def_exc_log = arr_lambda_by_name(my_settings.EXCEPTION_CLOSE,
                                         exception_fields)
        self.mid_c_log(close_name, arr_funcs_call(def_exc_log, exception, exR))

        if my_settings.FLUSH_RESPONSE:
            glog.flush()
Ejemplo n.º 2
0
 def process_response(self,request,response):
     self.mid_c_log(my_settings.REQ_LOG_NAME,arr_funcs_call(self.def_res_log,request,response))
     if my_settings.FLUSH_RESPONSE:
         glog.flush()
     if glog.browser_uuid:
         response.set_cookie(my_settings.BROWSER_UUID_COOKIE, glog.browser_uuid, max_age=my_settings.BROWSER_UUID_COOKIE_MAX_AGE)
     return response
Ejemplo n.º 3
0
 def process_response(self, request, response):
     self.mid_c_log(my_settings.REQ_LOG_NAME,
                    arr_funcs_call(self.def_res_log, request, response))
     if my_settings.FLUSH_RESPONSE:
         glog.flush()
     if glog.browser_uuid:
         response.set_cookie(
             my_settings.BROWSER_UUID_COOKIE,
             glog.browser_uuid,
             max_age=my_settings.BROWSER_UUID_COOKIE_MAX_AGE)
     return response
Ejemplo n.º 4
0
    def _process_exception(self,exception,exR,close_name=my_settings.REQ_LOG_NAME):
        #save head exception information
        def_exc_log = arr_lambda_by_name(my_settings.EXCEPTION_FIELDS,exception_fields)
        glog.err([my_settings.EXCEPTION_TOP_NAME]+arr_funcs_call(def_exc_log,exception))
        
        #save frames info
        def_exc_log = arr_lambda_by_name(my_settings.EXCEPTION_STACK_FIELDS,exception_fields)
        frames = exR.get_traceback_frames()
        frames.reverse()
        for frame in frames:
            glog.err([my_settings.EXCEPTION_MIDDLE_NAME]+arr_funcs_call(def_exc_log,frame,exR))
        
        #save close info
        def_exc_log = arr_lambda_by_name(my_settings.EXCEPTION_CLOSE,exception_fields)
        self.mid_c_log(close_name,arr_funcs_call(def_exc_log,exception,exR))

        if my_settings.FLUSH_RESPONSE:
            glog.flush()