The advanced example in the docs doesn't work as advertised. The view-specific logger 'myapp1.views.super_important_view' doesn't actually catch anything, because sys._getframe(1).f_globals['__name__'] as used in jogger.__init__ only returns the module and does not include the name of the view. I modified it to this:
This is a hack anyway. It really needs to be rethought. Any python modules that are more than 1 directory deep won't work with the current implementation.
The advanced example in the docs doesn't work as advertised. The view-specific logger
'myapp1.views.super_important_view'
doesn't actually catch anything, becausesys._getframe(1).f_globals['__name__']
as used injogger.__init__
only returns the module and does not include the name of the view. I modified it to this:This code works for view functions (enough for me), but for methods, it doesn't include the name of the class, so there is still room for improvement.