Hide connect password from logs.

This commit is contained in:
Christian Kratky
2019-03-08 23:48:49 +01:00
parent 461bc6e594
commit 6e64d653c5
+7 -1
View File
@@ -27,7 +27,13 @@
public override string ToString()
{
return string.Concat("Connect: [ProtocolLevel=", ProtocolLevel, "] [ClientId=", ClientId, "] [Username=", Username, "] [Password=", Password, "] [KeepAlivePeriod=", KeepAlivePeriod, "] [CleanSession=", CleanSession, "]");
var password = Password;
if (!string.IsNullOrEmpty(password))
{
password = "****";
}
return string.Concat("Connect: [ProtocolLevel=", ProtocolLevel, "] [ClientId=", ClientId, "] [Username=", Username, "] [Password=", password, "] [KeepAlivePeriod=", KeepAlivePeriod, "] [CleanSession=", CleanSession, "]");
}
}
}