Esempio n. 1
0
 public void WriteLoggingSession(LoggingSession session)
 {
     wrapInSection("Logs", "yum", div =>
     {
         var tag = LoggingSessionWriter.Write(session);
         tag.AddClass("details");
         div.Append(tag);
     });
 }
 public void ShouldWriteFail()
 {
     var rpt = new DeploymentReport("HI");
     LoggingSession session = new LoggingSession();
     session.LogFor("hi").MarkFailure("BOOM!");
     session.HasErrors().ShouldBeTrue();
     rpt.WriteSuccessOrFail(session);
     rpt.Document.WriteToFile("bob.html");
 }
Esempio n. 3
0
        public void WriteSuccessOrFail(LoggingSession session)
        {
            var tag = _document.Add("div");
            var msg = "SUCCESS";
            tag.AddClass("alert");
            tag.AddClass("alert-success");

            if(session.HasErrors())
            {
                tag.RemoveClass("success");
                tag.RemoveClass("alert-success");

                msg = "FAIL";
            }

            tag.Text(msg);
        }
Esempio n. 4
0
        public void WriteSuccessOrFail(LoggingSession session)
        {
            var tag = _document.Add("div");
            var msg = "SUCCESS";
            tag.AddClass("success");

            if(session.HasErrors())
            {
                tag.RemoveClass("success");
                tag.AddClass("failure");

                msg = "FAIL";
            }

            tag.Add("p")
                .Style("margin", "0px 0px")
                .Style("text-indent","10px")
                .Text(msg);
        }
        public static TableTag Write(LoggingSession session)
        {
            var table = new TableTag();

            table.AddClass("table");
            table.AddHeaderRow(r =>
            {
                r.Header("Description");
                r.Header("Provenance");
            });

            session.EachLog((target, log) =>
            {
                table.AddBodyRow(row =>
                {
                    row.Add("td", td =>
                    {
                        td.Append(new HtmlTag("h3").Text("Directive: " + PackagingDiagnostics.GetTypeName(target)));
                        td.Append(new HtmlTag("h5").Text("Desc: " + target.ToString()));
                        var time = new HtmlTag("h6").Text(log.TimeInMilliseconds.ToString() + "ms");
                        td.Append(time);
                    });

                    row.Cell(log.Provenance);
                });

                if (log.FullTraceText().IsNotEmpty())
                {
                    table.AddBodyRow(row =>
                    {
                        row.Cell().Attr("colspan", "2").AddClass("log").Add("pre").Text(log.FullTraceText());
                        if (!log.Success)
                        {
                            row.AddClass("failure");
                        }
                    });
                }
            });

            return(table);
        }
Esempio n. 6
0
        public static TableTag Write(LoggingSession session)
        {
            var table = new TableTag();
            table.AddClass("table");
            table.AddHeaderRow(r =>
            {
                r.Header("Description");
                r.Header("Provenance");
            });

            session.EachLog((target, log) =>
            {
                table.AddBodyRow(row =>
                {
                    row.Add("td", td =>
                    {
                        td.Append(new HtmlTag("h3").Text("Directive: "+BottlingDiagnostics.GetTypeName(target)));
                        td.Append(new HtmlTag("h5").Text("Desc: " + target.ToString()));
                        var time = new HtmlTag("h6").Text(log.TimeInMilliseconds.ToString()+"ms");
                        td.Append(time);
                    });

                    row.Cell(log.Provenance);

                });

                if (log.FullTraceText().IsNotEmpty())
                {
                    table.AddBodyRow(row =>
                    {
                        row.Cell().Attr("colspan", "2").AddClass("log").Add("pre").Text(log.FullTraceText());
                        if (!log.Success)
                        {
                            row.AddClass("failure");
                        }
                    });
                }
            });

            return table;
        }
Esempio n. 7
0
        public static TableTag Write(LoggingSession session)
        {
            var table = new TableTag();

            table.AddHeaderRow(r =>
            {
                r.Header("Type");
                r.Header("Description");
                r.Header("Provenance");
                r.Header("Timing");
            });

            session.EachLog((target, log) =>
            {
                table.AddBodyRow(row =>
                {
                    row.Cell(PackagingDiagnostics.GetTypeName(target));
                    row.Cell(target.ToString());
                    row.Cell(log.Provenance);
                    row.Cell(log.TimeInMilliseconds.ToString()).AddClass("execution-time");
                });

                if (log.FullTraceText().IsNotEmpty())
                {
                    table.AddBodyRow(row =>
                    {
                        row.Cell().Attr("colspan", "4").Add("pre").AddClass("log").Text(log.FullTraceText());
                        if (!log.Success)
                        {
                            row.AddClass("failure");
                        }
                    });
                }
            });

            return(table);
        }
Esempio n. 8
0
        public static TableTag Write(LoggingSession session)
        {
            var table = new TableTag();
            table.AddHeaderRow(r =>
            {
                r.Header("Type");
                r.Header("Description");
                r.Header("Provenance");
                r.Header("Timing");
            });

            session.EachLog((target, log) =>
            {
                table.AddBodyRow(row =>
                {
                    row.Cell(PackagingDiagnostics.GetTypeName(target));
                    row.Cell(target.ToString());
                    row.Cell(log.Provenance);
                    row.Cell(log.TimeInMilliseconds.ToString()).AddClass("execution-time");
                });

                if (log.FullTraceText().IsNotEmpty())
                {
                    table.AddBodyRow(row =>
                    {
                        row.Cell().Attr("colspan", "4").Add("pre").AddClass("log").Text(log.FullTraceText());
                        if (!log.Success)
                        {
                            row.AddClass("failure");
                        }
                    });
                }
            });

            return table;
        }
 public PackageLogger(LoggingSession log)
 {
     _log = log;
 }
Esempio n. 10
0
 public BottlingDiagnostics(LoggingSession log)
 {
     _log = log;
 }
 public BottlingDiagnostics(LoggingSession log)
 {
     _log = log;
 }
 public PackagingDiagnostics(LoggingSession log)
 {
     _log = log;
 }
Esempio n. 13
0
 public BottleLogger(LoggingSession log)
 {
     _log = log;
 }
 public BottleLogger(LoggingSession log)
 {
     _log = log;
 }