diff --git a/src/MonoTorrent.Client/MonoTorrent.Client.Modes/Mode.cs b/src/MonoTorrent.Client/MonoTorrent.Client.Modes/Mode.cs index f5a4a5f10..47ee9be69 100644 --- a/src/MonoTorrent.Client/MonoTorrent.Client.Modes/Mode.cs +++ b/src/MonoTorrent.Client/MonoTorrent.Client.Modes/Mode.cs @@ -226,7 +226,7 @@ protected virtual void HandleHandshakeMessage (PeerId id, HandshakeMessage messa // match we should close the connection. I *think* uTorrent doesn't randomise peerids // for private torrents. It's not documented very well. We may need to relax this check // if other clients randomize for private torrents. - logger.Info (id.Connection, "HandShake.Handle - Invalid peerid"); + logger.InfoFormatted (id.Connection, "HandShake.Handle - Invalid peerid. Expected '{0}' but received '{1}'", id.Peer.Info.PeerId, message.PeerId); throw new TorrentException ("Supplied PeerID didn't match the one the tracker gave us"); } else { // We don't care about the mismatch for public torrents. uTorrent randomizes its PeerId, as do other clients. diff --git a/src/MonoTorrent.Client/MonoTorrent.Logging/Logger.cs b/src/MonoTorrent.Client/MonoTorrent.Logging/Logger.cs index e971802cd..26bd18e5e 100644 --- a/src/MonoTorrent.Client/MonoTorrent.Logging/Logger.cs +++ b/src/MonoTorrent.Client/MonoTorrent.Logging/Logger.cs @@ -106,6 +106,12 @@ internal void InfoFormatted (IPeerConnection connection, string formatString, ob Writer.Info ($"{connection.Uri}: {string.Format (formatString, p1)}"); } + internal void InfoFormatted (IPeerConnection connection, string formatString, object p1, object p2) + { + if (Writer != null) + Writer.Info ($"{connection.Uri}: {string.Format (formatString, p1, p2)}"); + } + internal void Error (string message) { if (Writer != null)