Next: Thread safety, Previous: Error handling, Up: Introduction to the library [Contents][Index]
In many cases things may not go as expected and further information, to assist debugging, from GnuTLS is desired. Those are the cases where the gnutls_global_set_log_level and gnutls_global_set_log_function are to be used. Those will print verbose information on the GnuTLS functions internal flow.
gnutls_global_set_log_levelgnutls_global_set_log_functionWhen debugging is not required, important issues, such as detected attacks on the protocol still need to be logged. This is provided by the logging function set by gnutls_global_set_audit_log_function. The provided function will receive an message and the corresponding TLS session. The session information might be used to derive IP addresses or other information about the peer involved.
log_func: it is the audit log function
This is the function where you set the logging function gnutls is
going to use. This is different from gnutls_global_set_log_function()
because it will report the session of the event if any. Note that
that session might be null if there is no corresponding TLS session.
gnutls_audit_log_func is of the form,
void (*gnutls_audit_log_func)( gnutls_session_t, int level, const char*);
Since: 3.0