alonho/pytrace

Document the API

Opened this issue · 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?

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.

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?

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.