include info-hash in verbose logs filenames

This commit is contained in:
Arvid Norberg 2012-10-06 00:33:10 +00:00
parent e44225cb57
commit 24103c6603
1 changed files with 5 additions and 1 deletions

View File

@ -242,7 +242,11 @@ namespace libtorrent
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING
error_code ec;
TORRENT_ASSERT(m_socket->remote_endpoint(ec) == m_remote || ec);
m_logger = m_ses.create_log(m_remote.address().to_string(ec) + "_"
std::string torrent_name;
if (t) torrent_name = to_hex(t->info_hash().to_string());
m_logger = m_ses.create_log(torrent_name + '_'
+ m_remote.address().to_string(ec) + "_"
+ to_string(m_remote.port()).elems, m_ses.listen_port());
peer_log("%s [ ep: %s type: %s seed: %d p: %p local: %s]"
, m_outgoing ? ">>> OUTGOING_CONNECTION" : "<<< INCOMING CONNECTION"