当前位置: 首页>>代码示例>>C#>>正文


C# ILogger.NewLine方法代码示例

本文整理汇总了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();
            }
        }
开发者ID:omariom,项目名称:BenchmarkDotNet,代码行数:26,代码来源:MarkdownExporter.cs

示例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>");

        }
开发者ID:omariom,项目名称:BenchmarkDotNet,代码行数:28,代码来源:HtmlExporter.cs

示例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();
     }
 }
开发者ID:omariom,项目名称:BenchmarkDotNet,代码行数:20,代码来源:SummaryTableExtensions.cs

示例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();
     }
 }
开发者ID:omariom,项目名称:BenchmarkDotNet,代码行数:11,代码来源:CompositeDiagnoser.cs

示例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());
         }
     }
 }
开发者ID:omariom,项目名称:BenchmarkDotNet,代码行数:18,代码来源:PlainExporter.cs


注:本文中的ILogger.NewLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。