public static XElement WriteLogEntry(TestLoggerBackend.LogEntry instance) { var element = new XElement("LogEntry"); element.SetAttributeValue("Kind", instance.Kind); element.SetAttributeValue("LogLevel", instance.LogLevel); element.SetAttributeValue("Text", instance.Text); if (instance.Error != null) { var error = new XElement("Error"); error.SetAttributeValue("Text", instance.Error.Message); error.SetAttributeValue("StackTrace", instance.Error.StackTrace); element.Add(error); } return(element); }
public void LogEvent(TestLoggerBackend.LogEntry entry) { Logger.OnLogEvent(entry); }
public async Task LogEvent(TestLoggerBackend.LogEntry entry, CancellationToken cancellationToken) { LocalLogger.OnLogEvent(entry); var command = new LogCommand(); await command.Send(this, entry, cancellationToken); }