diff --git a/bindings/python/src/alert.cpp b/bindings/python/src/alert.cpp index 69543a9ae..3b5d8af8d 100644 --- a/bindings/python/src/alert.cpp +++ b/bindings/python/src/alert.cpp @@ -5,6 +5,7 @@ #include #include #include +#include // for piece_block #include using namespace boost::python; @@ -422,6 +423,8 @@ void bind_alert() .def_readonly("map_type", &portmap_alert::map_type) ; +#ifndef TORRENT_DISABLE_LOGGING + class_, noncopyable>( "portmap_log_alert", no_init) .def_readonly("map_type", &portmap_log_alert::map_type) @@ -431,6 +434,8 @@ void bind_alert() #endif ; +#endif // TORRENT_DISABLE_LOGGING + class_, noncopyable>( "fastresume_rejected_alert", no_init) .def_readonly("error", &fastresume_rejected_alert::error) @@ -665,6 +670,8 @@ void bind_alert() .add_property("ip", &dht_outgoing_get_peers_alert_ip) ; +#ifndef TORRENT_DISABLE_LOGGING + class_, noncopyable>( "log_alert", no_init) .def("msg", &log_alert::msg) @@ -680,6 +687,14 @@ void bind_alert() .def("msg", &peer_log_alert::msg) ; + class_, noncopyable>( + "picker_log_alert", no_init) + .add_property("picker_flags", &picker_log_alert::picker_flags) + .def("blocks", &picker_log_alert::blocks) + ; + +#endif // TORRENT_DISABLE_LOGGING + class_, noncopyable>( "lsd_error_alert", no_init) .def_readonly("error", &lsd_error_alert::error) @@ -687,8 +702,8 @@ void bind_alert() class_, noncopyable>( "dht_stats_alert", no_init) - .add_property("active_requests", &dht_stats_active_requests) - .add_property("routing_table", &dht_stats_routing_table) + .add_property("active_requests", &dht_stats_active_requests) + .add_property("routing_table", &dht_stats_routing_table) ; class_, noncopyable>( diff --git a/src/session_impl.cpp b/src/session_impl.cpp index c6ffad524..85a7bda26 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -5311,6 +5311,7 @@ retry: m_alerts.emplace_alert(t->get_handle(), peer); } + // TODO: perhaps this function should not exist when logging is disabled void session_impl::on_port_map_log( char const* msg, int map_transport) { @@ -5319,6 +5320,9 @@ retry: // log message if (m_alerts.should_post()) m_alerts.emplace_alert(map_transport, msg); +#else + TORRENT_UNUSED(msg); + TORRENT_UNUSED(map_transport); #endif }