本文整理汇总了C#中ILogger.NewLine方法的典型用法代码示例。如果您正苦于以下问题:C# ILogger.NewLine方法的具体用法?C# ILogger.NewLine怎么用?C# ILogger.NewLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILogger
的用法示例。
在下文中一共展示了ILogger.NewLine方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrintTable
private void PrintTable(SummaryTable table, ILogger logger)
{
if (table.FullContent.Length == 0)
{
logger.WriteLineError("There are no benchmarks found ");
logger.NewLine();
return;
}
table.PrintCommonColumns(logger);
logger.NewLine();
if (useCodeBlocks)
{
logger.Write("```");
logger.NewLine();
}
table.PrintLine(table.FullHeader, logger, "", " |");
logger.NewLine();
logger.WriteLineStatistic(string.Join("", table.Columns.Where(c => c.NeedToShow).Select(c => new string('-', c.Width) + " |")));
foreach (var line in table.FullContent)
{
table.PrintLine(line, logger, "", " |");
logger.NewLine();
}
}
示例2: PrintTable
private void PrintTable(SummaryTable table, ILogger logger)
{
if (table.FullContent.Length == 0)
{
logger.WriteLineError("<pre>There are no benchmarks found</pre>");
return;
}
logger.Write("<pre><code>");
table.PrintCommonColumns(logger);
logger.WriteLine("</code></pre>");
logger.NewLine();
logger.WriteLine("<table>");
var prefixLogger = new LoggerWithPrefix(logger, "\t");
prefixLogger.Write("<tr>");
table.PrintLine(table.FullHeader, prefixLogger, "<th>", "</th>");
prefixLogger.WriteLine("</tr>");
foreach (var line in table.FullContent)
{
prefixLogger.Write("<tr>");
table.PrintLine(line, prefixLogger, "<td>", "</td>");
prefixLogger.WriteLine("</tr>");
}
logger.WriteLine("</table>");
}
示例3: PrintCommonColumns
public static void PrintCommonColumns(this SummaryTable table, ILogger logger)
{
var commonColumns = table.Columns.Where(c => !c.NeedToShow && !c.IsTrivial).ToArray();
if (commonColumns.Any())
{
var paramsOnLine = 0;
foreach (var column in commonColumns)
{
logger.WriteInfo($"{column.Header}={column.Content[0]} ");
paramsOnLine++;
if (paramsOnLine == 3)
{
logger.NewLine();
paramsOnLine = 0;
}
}
if (paramsOnLine != 0)
logger.NewLine();
}
}
示例4: DisplayResults
public void DisplayResults(ILogger logger)
{
foreach (var diagnoser in diagnosers)
{
// TODO when Diagnosers/Diagnostis are wired up properly, instead of the Type name,
// print the name used on the cmd line, i.e. -d=<NAME>
logger.WriteLineHeader($"// * Diagnostic Output - {diagnoser.GetType().Name} *");
diagnoser.DisplayResults(logger);
logger.NewLine();
}
}
示例5: ExportToLog
public override void ExportToLog(Summary summary, ILogger logger)
{
foreach (var report in summary.Reports.Values)
{
var runs = report.AllMeasurements;
var modes = runs.Select(it => it.IterationMode).Distinct();
logger.WriteLineHeader($"*** {report.Benchmark.ShortInfo} ***");
logger.WriteLineHeader("* Raw *");
foreach (var run in runs)
logger.WriteLineResult(run.ToStr());
foreach (var mode in modes)
{
logger.NewLine();
logger.WriteLineHeader($"* Statistics for {mode}");
logger.WriteLineStatistic(runs.Where(it => it.IterationMode == mode).GetStatistics().ToTimeStr());
}
}
}