libssh2
1.\" Copyright (C) The libssh2 project and its contributors.
2.\" SPDX-License-Identifier: BSD-3-Clause
3.TH libssh2_trace_sethandler 3 "15 Jan 2010" "libssh2" "libssh2"
4.SH NAME
5libssh2_trace_sethandler - set a trace output handler
6.SH SYNOPSIS
7.nf
8#include <libssh2.h>
9
10typedef void (*libssh2_trace_handler_func)(LIBSSH2_SESSION *session,
11void *context,
12const char *data,
13size_t length);
14
15int
16libssh2_trace_sethandler(LIBSSH2_SESSION *session,
17void *context,
18libssh2_trace_handler_func callback);
19.fi
20.SH DESCRIPTION
21libssh2_trace_sethandler installs a trace output handler for your application.
22By default, when tracing has been switched on via a call to libssh2_trace(),
23all output is written to stderr. By calling this method and passing a
24function pointer that matches the libssh2_trace_handler_func prototype,
25libssh2 will call back as it generates trace output. This can be used to
26capture the trace output and put it into a log file or diagnostic window.
27This function has no effect unless libssh2 was built to support this option,
28and a typical "release build" might not.
29
30\fBcontext\fP can be used to pass arbitrary user defined data back into the callback when invoked.
31.SH AVAILABILITY
32Added in libssh2 version 1.2.3
33