From 2a3f4e2360671a39486bad488f301fd5f270e32b Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 24 Jan 2014 07:07:04 +0000 Subject: [PATCH] merged verbose logging change from RC_0_16 --- src/peer_connection.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index e491075aa..5a3a49a5a 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -240,9 +240,12 @@ namespace libtorrent #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING error_code ec; TORRENT_ASSERT(m_socket->remote_endpoint(ec) == m_remote || ec); - std::string log_name = m_remote.address().to_string(ec) + "_" - + to_string(m_remote.port()).elems; - + tcp::endpoint local_ep = m_socket->local_endpoint(ec); + std::string log_name = "[" + local_ep.address().to_string(ec) + "#" + + to_string(local_ep.port()).elems + "]-" + "[" + m_remote.address().to_string(ec) + "#" + + to_string(m_remote.port()).elems + "]"; + if (t) log_name = combine_path(to_hex(t->info_hash().to_string()) , log_name); @@ -252,7 +255,7 @@ namespace libtorrent , print_endpoint(m_remote).c_str() , m_socket->type_name() , m_peer_info ? m_peer_info->seed : 0, m_peer_info - , print_endpoint(m_socket->local_endpoint(ec)).c_str()); + , print_endpoint(local_ep).c_str()); #endif #ifndef TORRENT_DISABLE_GEO_IP m_inet_as_name = m_ses.as_name_for_ip(m_remote.address());