Override ToString() for LogMessage

This commit is contained in:
Christian
2018-03-13 20:23:07 +01:00
parent e1d8697331
commit 6e828d091f
@@ -28,5 +28,16 @@ namespace MQTTnet.Diagnostics
public string Message { get; }
public Exception Exception { get; }
public override string ToString()
{
var result = $"[{Timestamp:O}] [{LogId}] [{ThreadId}] [{Source}] [{Level}]: {Message}";
if (Exception != null)
{
result += Environment.NewLine + Exception;
}
return result;
}
}
}