[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Registering a logging callback
[Thread Prev] | [Thread Next]
- Subject: Registering a logging callback
- From: Jonathon Francis <jogofo@xxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Tue, 10 Jun 2014 11:37:54 +1000
- To: libssh@xxxxxxxxxx
Hi All,
I am trying to register a logging callback so I can handle logging
independently,
but I can't seem to get
it
to work.
I have the following code in my app:
static void ssh_log_function(int priority, const char *function, const char
*buffer, void *userdata)
{
cout << priority << " " << function << endl << buffer << endl;
cout << "And now for something completely different" << endl;
}
Then later in my app, before I execute some libssh commands, I have this:
ssh_set_log_callback(ssh_log_function);
When I compile and execute, I get the usual logging output to stderr and no
sign of the function I created
being executed
.
Have I missed something or am I doing it completely wrong? I have tried
passing &ssh_log_function as well but it didn't make any difference.
Would appreciate any help
- t
hanks!
Regards,
Jonathon Francis
| Re: Registering a logging callback | Andreas Schneider <asn@xxxxxxxxxxxxxx> |