Closed yantaozhao closed 1 year ago
Thanks for offering these feature requests. Most of these seem to me barely worth the maintenance burden. Out of all of these, the one that sounds the best is the feature request for including and excluding paths. If you'd like to implement this feature, let me warn you in advance: I'll make a list of requirements of exactly how it should behave, and I'd want you to write the whole thing, including extensive tests. It'll have to support Python versions 2.7+, and I'll also want you to run the tests on enough Python versions to be very confident that it works everywhere.
I'm letting you know in advance so if this is too much for you, you could let it go before you put any effort in. If it's not too much for you, create a separate feature request for this specific issue and I'll list my requirements.
Thank you for your hard work to maintenance PySnooper. maybe someone will implement the features in future. You can close the issue if you want.
PySnooper is an awesome tool to tracing program runs.
It would be more powerful if add new features/options through
snoop()
parameters, descripted below:output:
----Source path:... test/hello.py # <-customized indent char, and optional more indent level ----call 10 def main(): tons of program output here! --------call 15 def foo(): tons of program output here! maybe more nested calls. tons of program output here! --------return 16 return None ----return 20 print('bye') ----Return value:.. None
output:
----Return value:.. <class 'torch.Tensor'> tensor([...]) # <-show return type
[ ] disable newish strings like
Starting var
andNew var
lines. It can speedup snoop significantly without waiting minutes or even hours in case these values are not cared.[ ] ignore some trace events. Sometimes I want to be focus on only function call/return, but not lines inside function which are executed. then I want to ignore the
line
event to minimize the output.To prove the ideas, I've made some changes in the fork to implement above features, without adapting to early python version.
Any discussions or ideas are welcome.