# Path: zengine/config.py

# 
# Path: zengine/log.py



import json
import falcon
import sys
from zengine.config import settings
from zengine.log import log
                log.info("REQUEST DATA: %s" % json_data)
            except:
                log.exception("ERR: REQUEST DATA CANT BE LOGGED ")
        except (ValueError, UnicodeDecodeError):
            raise falcon.HTTPError(falcon.HTTP_753,
                                   'Malformed JSON',
                                   'Could not decode the request body. The '
                                   'JSON was incorrect or not encoded as '
                                   'UTF-8.')

    def process_response(self, req, resp, resource):
        """
        Serializes ``req.context['result']`` to resp.body as JSON.

        If :attr:`~zengine.settings.DEBUG` is True,
        ``sys._debug_db_queries`` (set by pyoko) added to response.

        """
        if 'result' not in req.context:
            return
        req.context['result']['is_login'] = 'user_id' in req.env['session']
        if settings.DEBUG:
            req.context['result']['_debug_queries'] = sys._debug_db_queries
            sys._debug_db_queries = []
        if resp.body is None and req.context['result']:
            resp.body = json.dumps(req.context['result'])

        try:
            log.debug("RESPONSE: %s" % resp.body)
        except:

# Path: zengine/config.py

# 
# Path: zengine/log.py



# Path: zengine/middlewares.py
import json
import falcon
import sys
from zengine.config import settings
from zengine.log import log

                log.info("REQUEST DATA: %s" % json_data)
            except:
                log.exception("ERR: REQUEST DATA CANT BE LOGGED ")
        except (ValueError, UnicodeDecodeError):
            raise falcon.HTTPError(falcon.HTTP_753,
                                   'Malformed JSON',
                                   'Could not decode the request body. The '
                                   'JSON was incorrect or not encoded as '
                                   'UTF-8.')

    def process_response(self, req, resp, resource):
        """
        Serializes ``req.context['result']`` to resp.body as JSON.

        If :attr:`~zengine.settings.DEBUG` is True,
        ``sys._debug_db_queries`` (set by pyoko) added to response.

        """
        if 'result' not in req.context:
            return
        req.context['result']['is_login'] = 'user_id' in req.env['session']
        if settings.DEBUG:
            req.context['result']['_debug_queries'] = sys._debug_db_queries
            sys._debug_db_queries = []
        if resp.body is None and req.context['result']:
            resp.body = json.dumps(req.context['result'])

        try:
            log.debug("RESPONSE: %s" % resp.body)
        except:

            log.exception("ERR: RESPONSE CANT BE LOGGED ")