Improve Telepathy debug messages (#2106)

This commit is contained in:
Anastasios Andronidis 2020-07-28 20:45:00 +03:00 committed by GitHub
parent 3756285e2d
commit 92bc3c3150
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,7 @@ void ReceiveThreadFunction(string ip, int port)
{ {
// this happens if (for example) the ip address is correct // this happens if (for example) the ip address is correct
// but there is no server running on that ip/port // but there is no server running on that ip/port
Logger.Log("Client Recv: failed to connect to ip=" + ip + " port=" + port + " reason=" + exception); Logger.LogError($"Client Recv: failed to connect to ip={ip} port={port} reason={exception}");
// add 'Disconnected' event to message queue so that the caller // add 'Disconnected' event to message queue so that the caller
// knows that the Connect failed. otherwise they will never know // knows that the Connect failed. otherwise they will never know
@ -88,7 +88,7 @@ void ReceiveThreadFunction(string ip, int port)
catch (Exception exception) catch (Exception exception)
{ {
// something went wrong. probably important. // something went wrong. probably important.
Logger.LogError("Client Recv Exception: " + exception); Logger.LogError($"Client Recv Exception: {exception}");
} }
// sendthread might be waiting on ManualResetEvent, // sendthread might be waiting on ManualResetEvent,
@ -203,7 +203,7 @@ public bool Send(byte[] data)
sendPending.Set(); sendPending.Set();
return true; return true;
} }
Logger.LogError("Client.Send: message too big: " + data.Length + ". Limit: " + MaxMessageSize); Logger.LogError($"Client.Send: message too big: {data.Length}. Limit: {MaxMessageSize}");
return false; return false;
} }
Logger.LogWarning("Client.Send: not connected!"); Logger.LogWarning("Client.Send: not connected!");