From 4dab854e0867a43b06ee72eefe59553c5ea4653e Mon Sep 17 00:00:00 2001 From: Nils Maier Date: Mon, 6 Jan 2014 17:43:47 +0100 Subject: [PATCH] GnuTLS: Refine debug logging --- src/LogFactory.cc | 2 +- src/Platform.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/LogFactory.cc b/src/LogFactory.cc index 0db6b2a7..6773526e 100644 --- a/src/LogFactory.cc +++ b/src/LogFactory.cc @@ -68,7 +68,7 @@ void LogFactory::adjustDependentLevels() { } #ifdef HAVE_LIBGNUTLS if (level == Logger::A2_DEBUG) { - gnutls_global_set_log_level(10); + gnutls_global_set_log_level(6); } else { gnutls_global_set_log_level(0); diff --git a/src/Platform.cc b/src/Platform.cc index e04f4fc1..96c12db1 100644 --- a/src/Platform.cc +++ b/src/Platform.cc @@ -74,7 +74,10 @@ namespace { void gnutls_log_callback(int level, const char *str) { using namespace aria2; - A2_LOG_DEBUG(fmt("GNUTLS: %d / %s", level, str)); + // GnuTLS adds a newline. Drop it. + std::string msg(str); + msg.resize(msg.size() - 1); + A2_LOG_DEBUG(fmt("GnuTLS: <%d> %s", level, msg.c_str())); } }