# HG changeset patch # User Laurent Peuch # Date 1560362280 -7200 # Node ID 90348f847b4b9e9c521fbd97add42b02f895a4b7 # Parent 6e98699d3a9a4e7427a67d6f82639157e0854111 [pyramid/debug] on every request display request path and selected controller This will display lines like: 2019-06-12 16:26:57 - (cubicweb.pyramid.bwcompat) INFO: REQUEST [view] '/wiki/334037' selected controller at /root/.virtualenvs/abreton/local/lib/python2.7/site-packages/cubicweb/web/views/basecontrollers.py:120 2019-06-12 16:26:59 - (cubicweb.pyramid.bwcompat) INFO: REQUEST [data] '/data/ea5eb3b6f89fba0ff4b671093c88d3dd/images/cartouche-mur.jpg' selected controller at /root/.virtualenvs/abreton/local/lib/python2.7/site-packages/cubicweb/web/views/staticcontrollers.py:179 The make debugging easier as this isn't done already. Most other web frameworks do something similar for the developper to be able to understand what is happening right now. Closes #17219741 diff -r 6e98699d3a9a -r 90348f847b4b cubicweb/pyramid/bwcompat.py --- a/cubicweb/pyramid/bwcompat.py Wed Aug 21 04:52:08 2019 +0200 +++ b/cubicweb/pyramid/bwcompat.py Wed Jun 12 19:58:00 2019 +0200 @@ -21,6 +21,7 @@ """Backward compatibility layer for CubicWeb to run as a Pyramid application.""" import sys +import inspect import logging from pyramid import security @@ -88,7 +89,12 @@ try: controller = vreg['controllers'].select( ctrlid, req, appli=self.appli) + log.info("REQUEST [%s] '%s' selected controller %s at %s:%s", + ctrlid, req.path, controller, + inspect.getsourcefile(controller.__class__), + inspect.getsourcelines(controller.__class__)[1]) except cubicweb.NoSelectableObject: + log.warn("WARNING '%s' unauthorized request", req.path) raise httpexceptions.HTTPUnauthorized( req._('not authorized'))