Commits

Elliot Peele committed 2762773 Draft

log any view config

  • Participants
  • Parent commits 27ceef8

Comments (0)

Files changed (1)

File authztest/views.py

-from pyramid.view import view_config
+import logging
+
+log = logging.getLogger('authztest.views')
+
+from pyramid.view import view_config as pyramid_view_config
 from pyramid.view import view_defaults as pyramid_view_defaults
 from pyramid.security import forget
 from pyramid.security import remember
 from pyramid.httpexceptions import HTTPNotImplemented
 
+class view_config(pyramid_view_config):
+    def __call__(self, wrapped):
+        wrapped = pyramid_view_config.__call__(self, wrapped)
+        log.debug('applying view config to %s %s %s'
+            % (wrapped, getattr(self, 'route_name', None),
+               getattr(self, '', None)))
+
+
 class view_defaults(pyramid_view_defaults):
     def __call__(self, wrapped):
         defaults = {}