summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-11-16 17:17:55 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-11-16 17:18:26 +0100
commited981cd02f1ec9e3dbee36db32db99f91d957006 (patch)
tree5995d6bd0c83b73e509e0ca9f26bc017b56a5302
parent1d8085c879ae6002938ea7a89761a360ff27345d (diff)
downloadgnutls-ed981cd02f1ec9e3dbee36db32db99f91d957006.tar.gz
if GNUTLS_DEBUG_LEVEL is specified the log function is not updated if it is already set.
-rw-r--r--lib/gnutls_global.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gnutls_global.c b/lib/gnutls_global.c
index 83cdd9f5ae..30828a3ab8 100644
--- a/lib/gnutls_global.c
+++ b/lib/gnutls_global.c
@@ -206,8 +206,9 @@ int gnutls_global_init(void)
if (e != NULL) {
level = atoi(e);
gnutls_global_set_log_level(level);
- gnutls_global_set_log_function(default_log_func);
- fprintf(stderr, "Enabled GnuTLS logging on stderr\n");
+ if (_gnutls_log_func == NULL)
+ gnutls_global_set_log_function(default_log_func);
+ _gnutls_debug_log("Enabled GnuTLS logging...\n");
}
if (gl_sockets_startup(SOCKETS_1_1))