From df74cbb78a24db30d74433c7afe14550dfc3e84e Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 17 Feb 2008 22:51:03 +0000 Subject: [PATCH] fixed logging=errors configuration --- include/libtorrent/aux_/session_impl.hpp | 8 ++++---- include/libtorrent/session.hpp | 4 ++-- include/libtorrent/torrent.hpp | 2 +- include/libtorrent/tracker_manager.hpp | 2 +- src/session.cpp | 8 ++++---- src/session_impl.cpp | 10 +++++----- src/udp_tracker_connection.cpp | 18 +++++++++--------- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/include/libtorrent/aux_/session_impl.hpp b/include/libtorrent/aux_/session_impl.hpp index 7b1edf712..0d8fc76a2 100644 --- a/include/libtorrent/aux_/session_impl.hpp +++ b/include/libtorrent/aux_/session_impl.hpp @@ -161,7 +161,7 @@ namespace libtorrent 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; #endif @@ -185,7 +185,7 @@ namespace libtorrent std::pair listen_port_range , fingerprint const& cl_fprint , 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 #endif ); @@ -595,7 +595,7 @@ namespace libtorrent // the number of send buffers that are allocated int m_buffer_allocations; #endif -#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) +#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING boost::shared_ptr create_log(std::string const& name , int instance, bool append = true); @@ -629,7 +629,7 @@ namespace libtorrent boost::scoped_ptr 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 { tracker_logger(session_impl& ses): m_ses(ses) {} diff --git a/include/libtorrent/session.hpp b/include/libtorrent/session.hpp index cf1c593a3..402630b2f 100755 --- a/include/libtorrent/session.hpp +++ b/include/libtorrent/session.hpp @@ -124,7 +124,7 @@ namespace libtorrent session(fingerprint const& print = fingerprint("LT" , 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 = "." #endif ); @@ -132,7 +132,7 @@ namespace libtorrent fingerprint const& print , std::pair listen_port_range , 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 = "." #endif ); diff --git a/include/libtorrent/torrent.hpp b/include/libtorrent/torrent.hpp index dfeef53e6..70d72a4cf 100755 --- a/include/libtorrent/torrent.hpp +++ b/include/libtorrent/torrent.hpp @@ -520,7 +520,7 @@ namespace libtorrent torrent_handle get_handle() const; // 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); #endif diff --git a/include/libtorrent/tracker_manager.hpp b/include/libtorrent/tracker_manager.hpp index 823ae3059..031099d7d 100755 --- a/include/libtorrent/tracker_manager.hpp +++ b/include/libtorrent/tracker_manager.hpp @@ -136,7 +136,7 @@ namespace libtorrent 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; #endif private: diff --git a/src/session.cpp b/src/session.cpp index 9528c3d3c..87d22ae94 100755 --- a/src/session.cpp +++ b/src/session.cpp @@ -112,12 +112,12 @@ namespace libtorrent fingerprint const& id , std::pair listen_port_range , 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 #endif ) : 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 #endif )) @@ -138,11 +138,11 @@ namespace libtorrent } 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 #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)) #else : m_impl(new session_impl(std::make_pair(0, 0), id, "0.0.0.0")) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 4257bc440..667456f3a 100755 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -485,7 +485,7 @@ namespace detail std::pair listen_port_range , fingerprint const& cl_fprint , 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 #endif ) @@ -521,7 +521,7 @@ namespace detail #endif , m_timer(m_io_service) , 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) #endif , 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::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) << time_now_string() << "\n"; #endif @@ -1619,7 +1619,7 @@ namespace detail return boost::weak_ptr(); } -#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) +#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING boost::shared_ptr session_impl::create_log(std::string const& name , int instance, bool append) { @@ -1912,7 +1912,7 @@ namespace detail } #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) << time_now_string() << "\n"; #endif diff --git a/src/udp_tracker_connection.cpp b/src/udp_tracker_connection.cpp index 214b57d4f..3ede59253 100755 --- a/src/udp_tracker_connection.cpp +++ b/src/udp_tracker_connection.cpp @@ -107,7 +107,7 @@ namespace libtorrent ? m_settings.stop_tracker_timeout : m_settings.tracker_completion_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 cb = requester(); if (cb) cb->debug_log(("*** UDP_TRACKER [ initiating name lookup: " + hostname + " ]").c_str()); #endif @@ -124,7 +124,7 @@ namespace libtorrent } boost::shared_ptr 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 ]"); #endif restart_read_timeout(); @@ -168,7 +168,7 @@ namespace libtorrent 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 cb = requester(); if (cb) cb->debug_log("*** UDP_TRACKER [ timed out ]"); #endif @@ -195,7 +195,7 @@ namespace libtorrent // ignore packet not sent from the tracker if (m_target != ep) return; -#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) +#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING boost::shared_ptr cb = requester(); if (cb) { @@ -214,7 +214,7 @@ namespace libtorrent int action = 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) { std::stringstream msg; @@ -235,7 +235,7 @@ namespace libtorrent // ignore packets that's not a response to our message if (action != m_state) return; -#if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) +#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING if (cb) { std::stringstream msg; @@ -280,7 +280,7 @@ namespace libtorrent 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 cb = requester(); if (cb) { @@ -359,7 +359,7 @@ namespace libtorrent } boost::shared_ptr 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_ANNOUNCE_RESPONSE"); @@ -478,7 +478,7 @@ namespace libtorrent 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 cb = requester(); if (cb) {