Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        public string FormatStory(IStory story, string handlerName)
        {
            StringBuilder str = new StringBuilder();

            foreach (var entry in story.GetLogs())
            {
                if (entry.Severity < this.severityThreshold)
                {
                    continue;
                }

                str.AppendFormat("{0}|{1}|{2}|{3}\n", entry.DateTime, entry.Severity, (entry.DateTime - story.StartDateTime), entry.Text);
            }

            return(str.ToString());
        }
Ejemplo n.º 4
0
        public string FormatStory(IStory story, string handlerName)
        {
            StringBuilder str = new StringBuilder();

            foreach (var entry in story.GetLogs())
            {
                if (entry.Severity < this.severityThreshold)
                {
                    continue;
                }

                str.AppendFormat("{0}|{1}|{2}|{3}\n", entry.DateTime, entry.Severity, (entry.DateTime - story.StartDateTime), entry.Text);
            }

            return str.ToString();
        }