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"); }
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); }
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); }
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; }
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 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; }
public BottlingDiagnostics(LoggingSession log) { _log = log; }
public PackagingDiagnostics(LoggingSession log) { _log = log; }
public BottleLogger(LoggingSession log) { _log = log; }