Fix the exception throw during logging.

The '{}' in the message causes formatter exception when it appears in
string interpolation.
This commit is contained in:
Troy Dai 2016-02-04 22:10:57 -08:00
parent 5075b8892e
commit 78a7f6d8d1

View file

@ -59,7 +59,7 @@ namespace Microsoft.DotNet.ProjectModel.Server
{ {
return Send(_writer => return Send(_writer =>
{ {
_log.LogInformation($"Send ({message})"); _log.LogInformation("OnSend ({0})", message);
_writer.Write(JsonConvert.SerializeObject(message)); _writer.Write(JsonConvert.SerializeObject(message));
}); });
} }
@ -73,7 +73,7 @@ namespace Microsoft.DotNet.ProjectModel.Server
var content = _reader.ReadString(); var content = _reader.ReadString();
var message = JsonConvert.DeserializeObject<Message>(content); var message = JsonConvert.DeserializeObject<Message>(content);
_log.LogInformation($"OnReceive({message})"); _log.LogInformation("OnReceive ({0})", message);
OnReceive(message); OnReceive(message);
} }
} }