Added tracing support

In the interests of reducing autogenerated code, could this logic be moved into a `connect` function in the Unix version of the library?  That would also make it easier to use interactively since all the code above wouldnt need to be typed in.