From 1805c96f446e1972486fcf3b7828c62f6e1a4e36 Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Tue, 11 Aug 2015 19:56:44 -0400 Subject: [PATCH 1/2] Created a new port_mapping_log_notification alert category to separate portmap_log_alert. --- include/libtorrent/alert.hpp | 4 ++++ include/libtorrent/alert_types.hpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/libtorrent/alert.hpp b/include/libtorrent/alert.hpp index ce54939b7..c15d5ec80 100644 --- a/include/libtorrent/alert.hpp +++ b/include/libtorrent/alert.hpp @@ -195,6 +195,10 @@ namespace libtorrent { // enable events from pure dht operations not related to torrents dht_operation_notification = 0x40000, + // enables port mapping log events. This log is useful + // for debugging the UPnP or NAT-PMP implementation + port_mapping_log_notification = 0x80000, + // The full bitmask, representing all available categories. // // since the enum is signed, make sure this isn't diff --git a/include/libtorrent/alert_types.hpp b/include/libtorrent/alert_types.hpp index 1eb2a30fc..bbeb94ed9 100644 --- a/include/libtorrent/alert_types.hpp +++ b/include/libtorrent/alert_types.hpp @@ -1398,7 +1398,7 @@ namespace libtorrent TORRENT_DEFINE_ALERT(portmap_log_alert, 52) - static const int static_category = alert::port_mapping_notification; + static const int static_category = alert::port_mapping_log_notification; virtual std::string message() const; int map_type; From 2457b16d096a44715daaa474acc0f9b4f9fb2603 Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Wed, 12 Aug 2015 00:10:32 -0400 Subject: [PATCH 2/2] Documented that portmap_log_alert is only posted if port_mapping_log_notification is enabled. --- include/libtorrent/alert_types.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/libtorrent/alert_types.hpp b/include/libtorrent/alert_types.hpp index bbeb94ed9..271593a5c 100644 --- a/include/libtorrent/alert_types.hpp +++ b/include/libtorrent/alert_types.hpp @@ -1390,7 +1390,9 @@ namespace libtorrent // This alert is generated to log informational events related to either // UPnP or NAT-PMP. They contain a log line and the type (0 = NAT-PMP // and 1 = UPnP). Displaying these messages to an end user is only useful - // for debugging the UPnP or NAT-PMP implementation. + // for debugging the UPnP or NAT-PMP implementation. This alert is only + // posted if the alert::port_mapping_log_notification flag is enabled in + // the alert mask. struct TORRENT_EXPORT portmap_log_alert: alert { // internal