From eaa8f0c97f5659ded561ac0f7dd93feabb79af8b Mon Sep 17 00:00:00 2001
From: Pierre Krieger <pierre.krieger1708@gmail.com>
Date: Fri, 22 Feb 2019 13:48:59 +0100
Subject: [PATCH] Add back logging when we ban a peer (#1843)

* Add back logging when we ban a peer

* Make it less verbose
---
 substrate/core/network/src/service.rs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/substrate/core/network/src/service.rs b/substrate/core/network/src/service.rs
index ac6789f718c..df5c035ec6a 100644
--- a/substrate/core/network/src/service.rs
+++ b/substrate/core/network/src/service.rs
@@ -17,7 +17,7 @@
 use std::collections::HashMap;
 use std::sync::Arc;
 use std::{io, thread};
-use log::{warn, debug, error, trace};
+use log::{warn, debug, error, trace, info};
 use futures::{Async, Future, Stream, stream, sync::oneshot};
 use parking_lot::Mutex;
 use network_libp2p::{ProtocolId, NetworkConfiguration, NodeIndex, ErrorKind, Severity};
@@ -509,7 +509,10 @@ fn run_thread<B: BlockT + 'static, S: NetworkSpecialization<B>>(
 			},
 			NetworkMsg::ReportPeer(who, severity) => {
 				match severity {
-					Severity::Bad(_) => network_service_2.lock().ban_node(who),
+					Severity::Bad(message) => {
+						info!(target: "sync", "Banning {:?} because {:?}", who, message);
+						network_service_2.lock().ban_node(who)
+					},
 					Severity::Useless(_) => network_service_2.lock().drop_node(who),
 					Severity::Timeout => network_service_2.lock().drop_node(who),
 				}
-- 
GitLab