Skip to content

Instantly share code, notes, and snippets.

@wiredfool
Created March 4, 2018 12:15
Show Gist options
  • Save wiredfool/3e8aedea816d52376221b5ee0dd16285 to your computer and use it in GitHub Desktop.
Save wiredfool/3e8aedea816d52376221b5ee0dd16285 to your computer and use it in GitHub Desktop.
For figuring out where stuff is called when deep in web frameworks.
import inspect;
stack = "".join("""%s:%s %s\n%s""" %(f.filename, f.lineno, f.function, f.code_context[0])
for f in inspect.stack()[1:10])
logger.debug(stack)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment