public string FormatStory(IStory story, string handlerName) { StringBuilder str = new StringBuilder(); str.AppendFormat("{0}\n Story {1} ({2}) on rule {3}\n", story.StartDateTime, story.Name, story.InstanceId, handlerName); foreach (var item in story.GetDataValues()) { if (item.Value != null) { str.AppendFormat(" {0} - {1}\n", item.Key, item.Value.GetType().IsValueType ? item.Value : item.Value.Serialize()); } } str.Append('\n'); foreach (var line in story.GetLogs()) { if (line.Severity < this.severityThreshold) { continue; } str.AppendFormat(" +{0} ms {1} {2}\n", (line.DateTime - story.StartDateTime).TotalMilliseconds, line.Severity, line.Text /*, line.Origin*/); } str.Append('\n'); AddStory(story, str, 1); str.Append('\n'); return(str.ToString()); }
public string FormatStory(IStory story, string handlerName) { StringBuilder str = new StringBuilder(); str.AppendFormat("{0}\n Story {1} ({2}) on rule {3}\n", story.StartDateTime, story.Name, story.InstanceId, handlerName); foreach (var item in story.GetDataValues()) { if (item.Value != null) { str.AppendFormat(" {0} - {1}\n", item.Key, item.Value.GetType().IsValueType ? item.Value : item.Value.Serialize()); } } str.Append('\n'); foreach (var line in story.GetLogs()) { if (line.Severity < this.severityThreshold) { continue; } str.AppendFormat(" +{0} ms {1} {2}\n", (line.DateTime - story.StartDateTime).TotalMilliseconds, line.Severity, line.Text/*, line.Origin*/); } str.Append('\n'); AddStory(story, str, 1); str.Append('\n'); return str.ToString(); }