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;
};
#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<int, int> 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<logger> create_log(std::string const& name
, int instance, bool append = true);
@ -629,7 +629,7 @@ namespace libtorrent
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
{
tracker_logger(session_impl& ses): m_ses(ses) {}

View File

@ -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<int, int> 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
);

View File

@ -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

View File

@ -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:

View File

@ -112,12 +112,12 @@ namespace libtorrent
fingerprint const& id
, std::pair<int, int> 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"))

View File

@ -485,7 +485,7 @@ namespace detail
std::pair<int, int> 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<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
, 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

View File

@ -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<request_callback> 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<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 ]");
#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<request_callback> 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<request_callback> 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<request_callback> cb = requester();
if (cb)
{
@ -359,7 +359,7 @@ namespace libtorrent
}
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_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<request_callback> cb = requester();
if (cb)
{