fixed logging=errors configuration

This commit is contained in:
Arvid Norberg 2008-02-17 22:51:03 +00:00
parent 77ac39c8c6
commit df74cbb78a
7 changed files with 26 additions and 26 deletions

View File

@ -161,7 +161,7 @@ namespace libtorrent
bool m_abort; bool m_abort;
}; };
#if defined(TORRENT_LOGGING) || defined(TORRENT_VERBOSE_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
struct tracker_logger; struct tracker_logger;
#endif #endif
@ -185,7 +185,7 @@ namespace libtorrent
std::pair<int, int> listen_port_range std::pair<int, int> listen_port_range
, fingerprint const& cl_fprint , fingerprint const& cl_fprint
, char const* listen_interface , char const* listen_interface
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
, fs::path const& logpath , fs::path const& logpath
#endif #endif
); );
@ -595,7 +595,7 @@ namespace libtorrent
// the number of send buffers that are allocated // the number of send buffers that are allocated
int m_buffer_allocations; int m_buffer_allocations;
#endif #endif
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
boost::shared_ptr<logger> create_log(std::string const& name boost::shared_ptr<logger> create_log(std::string const& name
, int instance, bool append = true); , int instance, bool append = true);
@ -629,7 +629,7 @@ namespace libtorrent
boost::scoped_ptr<boost::thread> m_checker_thread; boost::scoped_ptr<boost::thread> m_checker_thread;
}; };
#if defined(TORRENT_LOGGING) || defined(TORRENT_VERBOSE_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
struct tracker_logger : request_callback struct tracker_logger : request_callback
{ {
tracker_logger(session_impl& ses): m_ses(ses) {} tracker_logger(session_impl& ses): m_ses(ses) {}

View File

@ -124,7 +124,7 @@ namespace libtorrent
session(fingerprint const& print = fingerprint("LT" session(fingerprint const& print = fingerprint("LT"
, LIBTORRENT_VERSION_MAJOR, LIBTORRENT_VERSION_MINOR, 0, 0) , LIBTORRENT_VERSION_MAJOR, LIBTORRENT_VERSION_MINOR, 0, 0)
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
, fs::path logpath = "." , fs::path logpath = "."
#endif #endif
); );
@ -132,7 +132,7 @@ namespace libtorrent
fingerprint const& print fingerprint const& print
, std::pair<int, int> listen_port_range , std::pair<int, int> listen_port_range
, char const* listen_interface = "0.0.0.0" , char const* listen_interface = "0.0.0.0"
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
, fs::path logpath = "." , fs::path logpath = "."
#endif #endif
); );

View File

@ -520,7 +520,7 @@ namespace libtorrent
torrent_handle get_handle() const; torrent_handle get_handle() const;
// LOGGING // LOGGING
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
virtual void debug_log(const std::string& line); virtual void debug_log(const std::string& line);
#endif #endif

View File

@ -136,7 +136,7 @@ namespace libtorrent
tcp::endpoint m_tracker_address; tcp::endpoint m_tracker_address;
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
virtual void debug_log(const std::string& line) = 0; virtual void debug_log(const std::string& line) = 0;
#endif #endif
private: private:

View File

@ -112,12 +112,12 @@ namespace libtorrent
fingerprint const& id fingerprint const& id
, std::pair<int, int> listen_port_range , std::pair<int, int> listen_port_range
, char const* listen_interface , char const* listen_interface
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
, fs::path logpath , fs::path logpath
#endif #endif
) )
: m_impl(new session_impl(listen_port_range, id, listen_interface : m_impl(new session_impl(listen_port_range, id, listen_interface
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
, logpath , logpath
#endif #endif
)) ))
@ -138,11 +138,11 @@ namespace libtorrent
} }
session::session(fingerprint const& id session::session(fingerprint const& id
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
, fs::path logpath , fs::path logpath
#endif #endif
) )
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
: m_impl(new session_impl(std::make_pair(0, 0), id, "0.0.0.0", logpath)) : m_impl(new session_impl(std::make_pair(0, 0), id, "0.0.0.0", logpath))
#else #else
: m_impl(new session_impl(std::make_pair(0, 0), id, "0.0.0.0")) : m_impl(new session_impl(std::make_pair(0, 0), id, "0.0.0.0"))

View File

@ -485,7 +485,7 @@ namespace detail
std::pair<int, int> listen_port_range std::pair<int, int> listen_port_range
, fingerprint const& cl_fprint , fingerprint const& cl_fprint
, char const* listen_interface , char const* listen_interface
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
, fs::path const& logpath , fs::path const& logpath
#endif #endif
) )
@ -521,7 +521,7 @@ namespace detail
#endif #endif
, m_timer(m_io_service) , m_timer(m_io_service)
, m_next_connect_torrent(0) , m_next_connect_torrent(0)
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
, m_logpath(logpath) , m_logpath(logpath)
#endif #endif
, m_checker_impl(*this) , m_checker_impl(*this)
@ -545,7 +545,7 @@ namespace detail
m_bandwidth_manager[peer_connection::download_channel] = &m_download_channel; m_bandwidth_manager[peer_connection::download_channel] = &m_download_channel;
m_bandwidth_manager[peer_connection::upload_channel] = &m_upload_channel; m_bandwidth_manager[peer_connection::upload_channel] = &m_upload_channel;
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
m_logger = create_log("main_session", listen_port(), false); m_logger = create_log("main_session", listen_port(), false);
(*m_logger) << time_now_string() << "\n"; (*m_logger) << time_now_string() << "\n";
#endif #endif
@ -1619,7 +1619,7 @@ namespace detail
return boost::weak_ptr<torrent>(); return boost::weak_ptr<torrent>();
} }
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
boost::shared_ptr<logger> session_impl::create_log(std::string const& name boost::shared_ptr<logger> session_impl::create_log(std::string const& name
, int instance, bool append) , int instance, bool append)
{ {
@ -1912,7 +1912,7 @@ namespace detail
} }
#endif #endif
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
m_logger = create_log("main_session", listen_port(), false); m_logger = create_log("main_session", listen_port(), false);
(*m_logger) << time_now_string() << "\n"; (*m_logger) << time_now_string() << "\n";
#endif #endif

View File

@ -107,7 +107,7 @@ namespace libtorrent
? m_settings.stop_tracker_timeout ? m_settings.stop_tracker_timeout
: m_settings.tracker_completion_timeout : m_settings.tracker_completion_timeout
, m_settings.tracker_receive_timeout); , m_settings.tracker_receive_timeout);
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
boost::shared_ptr<request_callback> cb = requester(); boost::shared_ptr<request_callback> cb = requester();
if (cb) cb->debug_log(("*** UDP_TRACKER [ initiating name lookup: " + hostname + " ]").c_str()); if (cb) cb->debug_log(("*** UDP_TRACKER [ initiating name lookup: " + hostname + " ]").c_str());
#endif #endif
@ -124,7 +124,7 @@ namespace libtorrent
} }
boost::shared_ptr<request_callback> cb = requester(); boost::shared_ptr<request_callback> cb = requester();
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
if (cb) cb->debug_log("*** UDP_TRACKER [ name lookup successful ]"); if (cb) cb->debug_log("*** UDP_TRACKER [ name lookup successful ]");
#endif #endif
restart_read_timeout(); restart_read_timeout();
@ -168,7 +168,7 @@ namespace libtorrent
void udp_tracker_connection::on_timeout() void udp_tracker_connection::on_timeout()
{ {
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
boost::shared_ptr<request_callback> cb = requester(); boost::shared_ptr<request_callback> cb = requester();
if (cb) cb->debug_log("*** UDP_TRACKER [ timed out ]"); if (cb) cb->debug_log("*** UDP_TRACKER [ timed out ]");
#endif #endif
@ -195,7 +195,7 @@ namespace libtorrent
// ignore packet not sent from the tracker // ignore packet not sent from the tracker
if (m_target != ep) return; if (m_target != ep) return;
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
boost::shared_ptr<request_callback> cb = requester(); boost::shared_ptr<request_callback> cb = requester();
if (cb) if (cb)
{ {
@ -214,7 +214,7 @@ namespace libtorrent
int action = detail::read_int32(ptr); int action = detail::read_int32(ptr);
int transaction = detail::read_int32(ptr); int transaction = detail::read_int32(ptr);
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
if (cb) if (cb)
{ {
std::stringstream msg; std::stringstream msg;
@ -235,7 +235,7 @@ namespace libtorrent
// ignore packets that's not a response to our message // ignore packets that's not a response to our message
if (action != m_state) return; if (action != m_state) return;
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
if (cb) if (cb)
{ {
std::stringstream msg; std::stringstream msg;
@ -280,7 +280,7 @@ namespace libtorrent
void udp_tracker_connection::send_udp_connect() void udp_tracker_connection::send_udp_connect()
{ {
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
boost::shared_ptr<request_callback> cb = requester(); boost::shared_ptr<request_callback> cb = requester();
if (cb) if (cb)
{ {
@ -359,7 +359,7 @@ namespace libtorrent
} }
boost::shared_ptr<request_callback> cb = requester(); boost::shared_ptr<request_callback> cb = requester();
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
if (cb) if (cb)
{ {
cb->debug_log("<== UDP_TRACKER_ANNOUNCE_RESPONSE"); cb->debug_log("<== UDP_TRACKER_ANNOUNCE_RESPONSE");
@ -478,7 +478,7 @@ namespace libtorrent
TORRENT_ASSERT(out - buf == sizeof(buf)); TORRENT_ASSERT(out - buf == sizeof(buf));
#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
boost::shared_ptr<request_callback> cb = requester(); boost::shared_ptr<request_callback> cb = requester();
if (cb) if (cb)
{ {