cool-RR / PySnooper

Never use print for debugging again
MIT License
16.37k stars 951 forks source link

Snoop recursively, but only in my code. #225

Open guettli opened 2 years ago

guettli commented 2 years ago

Hi,

I would like to trace the http request handling of Django in my development environment.

But I am sure that the bug is in my code, not in the code of Django.

I would like to see every line of my code, excluding Django, standard library and other libraries.

I had a look at the arguments which snoop() accepts, but I think it is not possible up to now.

Would you accept a PR which implements this?

Do you have a hint how to implement this?

cool-RR commented 2 years ago

This is a good idea. How would you propose an API for that would look like? I have some thoughts but I want to hear yours first.

@alexmojaki If you'll have any opinion about this, I'll be happy to hear it.

alexmojaki commented 2 years ago

Link to the equivalent issue: https://github.com/alexmojaki/snoop/issues/51

To do something similar now In PySnooper I think you'd have to override Tracer._is_internal_frame.