pytrace icon indicating copy to clipboard operation
pytrace copied to clipboard

Document the API

Open thedrow opened this issue 11 years ago • 3 comments

I'd like to use PyTrace but I'd like to use it from a command line software that I am creating. Can you please point at what API I should be using? Also, could you document the API?

thedrow avatar Sep 05 '13 08:09 thedrow

What exactly are you trying to achieve? the API is very minimal: pytrace.start() and pytrace.stop() will trace execution and save the traces to a file in the current directory (traces.sqlite). start() takes an optional list of modules to trace in case you want to focus on a specific package or module. I'll update the documentation soon and add more configuration arguments like file name.

alonho avatar Sep 05 '13 20:09 alonho

I have a command line tool that runs tests and re-runs failing tests with tracing (among other things). Can I attach pytrace with another trace function?

thedrow avatar Sep 06 '13 07:09 thedrow

I'm assuming you mean whether you can register two tracing functions? (for example running tests with the coverage.py module in addition to pytrace). That's not possible. Python doesn't let you register multiple tracing functions. pytrace could support that by getting a function as a parameter to start. that can be a separate ticket.

alonho avatar Sep 06 '13 07:09 alonho