Skip to content

Example from the docs doesn't work #3

Description

@beniwohli

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:

caller = '%s.%s' % (sys._getframe(1).f_globals['__name__'], sys._getframe(1).f_code.co_name)

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions