summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNils Maier <maierman@web.de>2014-01-06 13:34:03 +0100
committerNils Maier <maierman@web.de>2014-01-06 13:40:51 +0100
commit7777e1cb37c49bd3263df7c4b837816b4ebba341 (patch)
tree9d57886319381deedfdab51007a78e798fc7c2b0 /src
parent2571bf4a364834b01fb915d02528c322ff0b2622 (diff)
GnuTLS: Setup logging
Diffstat (limited to 'src')
-rw-r--r--src/Platform.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Platform.cc b/src/Platform.cc
index 13337914..1e562f3a 100644
--- a/src/Platform.cc
+++ b/src/Platform.cc
@@ -66,9 +66,19 @@
#ifdef HAVE_LIBGMP
# include "a2gmp.h"
#endif // HAVE_LIBGMP
+#include "LogFactory.h"
#define A2_MIN_GCRYPT_VERSION "1.2.4"
+namespace {
+ void gnutls_log_callback(int level, const char *str)
+ {
+ using namespace aria2;
+ A2_LOG_DEBUG(fmt("GNUTLS: %d / %s", level, str));
+ }
+}
+
+
namespace aria2 {
bool Platform::initialized_ = false;
@@ -120,6 +130,9 @@ bool Platform::setUp()
throw DL_ABORT_EX(fmt("gnutls_global_init() failed, cause:%s",
gnutls_strerror(r)));
}
+
+ gnutls_global_set_log_function(gnutls_log_callback);
+ gnutls_global_set_log_level(10);
}
#endif // HAVE_LIBGNUTLS