On Nov 3, 2009, at 3:19 PM, Dave McCaldon wrote:

Attached is a git patch that implements libssh2_trace_sethandler(), which allows trace output to be captured by an application provided callback that libssh2_trace() and debugdump() will call instead of the default of always writing to stderr.

This will allow an application developer to be able to capture the libssh2 trace output to a log file, or into a diagnostic window. Note that as with libssh2_trace(), libssh2 must be configured with -- enable-debug otherwise this does nothing. Also note that if you enable tracing for LIBSSH2_DBG_TRANS, then you're going to get a lot of output in the form of packet hex dumps.

Previously, trace output always went to stderr, which mean you had to use dup2() to coerce your log file handle into stderr if you wanted to capture the output.

I have so far tested this on Mac OS X, Windows, Windows x64 and Linux (32-bit).

My apologies, I forgot to 'git add' the documentation for libssh2_trace_sethandler, so it was missing from the previous patch file. Here it is:

Attachment: 0001-Added-documentation-for-libssh2_trace_sethandler.patch
Description: Binary data

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to