forked from premiere/premiere-libtorrent
removed boost.date_time dependency from DHT logging code
This commit is contained in:
parent
517488c722
commit
eb5b532d3f
|
@ -399,9 +399,8 @@ namespace libtorrent { namespace dht
|
||||||
, m_in_buf[current_buffer].end());
|
, m_in_buf[current_buffer].end());
|
||||||
|
|
||||||
#ifdef TORRENT_DHT_VERBOSE_LOGGING
|
#ifdef TORRENT_DHT_VERBOSE_LOGGING
|
||||||
TORRENT_LOG(dht_tracker) << microsec_clock::universal_time()
|
TORRENT_LOG(dht_tracker) << time_now_string() << " RECEIVED ["
|
||||||
<< " RECEIVED [" << m_remote_endpoint[current_buffer]
|
<< m_remote_endpoint[current_buffer] << "]:";
|
||||||
<< "]:";
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
libtorrent::dht::msg m;
|
libtorrent::dht::msg m;
|
||||||
|
@ -784,10 +783,9 @@ namespace libtorrent { namespace dht
|
||||||
e["v"] = version_str;
|
e["v"] = version_str;
|
||||||
|
|
||||||
#ifdef TORRENT_DHT_VERBOSE_LOGGING
|
#ifdef TORRENT_DHT_VERBOSE_LOGGING
|
||||||
TORRENT_LOG(dht_tracker) << microsec_clock::universal_time()
|
TORRENT_LOG(dht_tracker) << time_now_string()
|
||||||
<< " SENDING [" << m.addr << "]:";
|
<< " SENDING [" << m.addr << "]:";
|
||||||
TORRENT_LOG(dht_tracker) << " transaction: " << m.transaction_id;
|
TORRENT_LOG(dht_tracker) << " transaction: " << m.transaction_id;
|
||||||
// e.print(std::cerr);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (m.message_id == messages::error)
|
if (m.message_id == messages::error)
|
||||||
|
@ -799,8 +797,8 @@ namespace libtorrent { namespace dht
|
||||||
error_list.list().push_back(entry(m.error_msg));
|
error_list.list().push_back(entry(m.error_msg));
|
||||||
e["e"] = error_list;
|
e["e"] = error_list;
|
||||||
#ifdef TORRENT_DHT_VERBOSE_LOGGING
|
#ifdef TORRENT_DHT_VERBOSE_LOGGING
|
||||||
TORRENT_LOG(dht_tracker) << " error: " << m.error_code << " "
|
TORRENT_LOG(dht_tracker) << time_now_string()
|
||||||
<< m.error_msg;
|
<< " error: " << m.error_code << " " << m.error_msg;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (m.reply)
|
else if (m.reply)
|
||||||
|
@ -811,8 +809,8 @@ namespace libtorrent { namespace dht
|
||||||
r["id"] = std::string(m.id.begin(), m.id.end());
|
r["id"] = std::string(m.id.begin(), m.id.end());
|
||||||
|
|
||||||
#ifdef TORRENT_DHT_VERBOSE_LOGGING
|
#ifdef TORRENT_DHT_VERBOSE_LOGGING
|
||||||
TORRENT_LOG(dht_tracker) << " reply: "
|
TORRENT_LOG(dht_tracker) << time_now_string()
|
||||||
<< messages::ids[m.message_id];
|
<< " reply: " << messages::ids[m.message_id];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (m.write_token.type() != entry::undefined_t)
|
if (m.write_token.type() != entry::undefined_t)
|
||||||
|
|
|
@ -161,8 +161,8 @@ bool rpc_manager::incoming(msg const& m)
|
||||||
|
|
||||||
#ifdef TORRENT_DHT_VERBOSE_LOGGING
|
#ifdef TORRENT_DHT_VERBOSE_LOGGING
|
||||||
std::ofstream reply_stats("libtorrent_logs/round_trip_ms.log", std::ios::app);
|
std::ofstream reply_stats("libtorrent_logs/round_trip_ms.log", std::ios::app);
|
||||||
reply_stats << m.addr << "\t" << (microsec_clock::universal_time()
|
reply_stats << m.addr << "\t" << total_milliseconds(time_now() - o->sent)
|
||||||
- o->sent).total_milliseconds() << std::endl;
|
<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
o->reply(m);
|
o->reply(m);
|
||||||
m_transactions[tid].reset();
|
m_transactions[tid].reset();
|
||||||
|
|
Loading…
Reference in New Issue