コード例 #1
0
ファイル: FctbLogger.cs プロジェクト: nus-ii/BenchmarkDotNet
 public void TextBoxWrite(BenchmarkLogKind logKind, string format, params object[] args)
 {
     var text = string.Format(EnvironmentHelper.MainCultureInfo, format, args);
     switch (logKind)
     {
         case BenchmarkLogKind.Default:
             textBox.AppendText(text, Default);
             break;
         case BenchmarkLogKind.Help:
             textBox.AppendText(text, Help);
             break;
         case BenchmarkLogKind.Header:
             textBox.AppendText(text, Header);
             break;
         case BenchmarkLogKind.Result:
             textBox.AppendText(text, Result);
             break;
         case BenchmarkLogKind.Statistic:
             textBox.AppendText(text, Statistic);
             break;
         case BenchmarkLogKind.Info:
             textBox.AppendText(text, Info);
             break;
         case BenchmarkLogKind.Error:
             textBox.AppendText(text, Error);
             break;
     }
 }
コード例 #2
0
 public void Write(BenchmarkLogKind logKind, string format, params object[] args)
 {
     foreach (var logger in loggers)
     {
         logger.Write(logKind, format, args);
     }
 }
コード例 #3
0
 public void Write(BenchmarkLogKind logKind, string format, params object[] args)
 {
     if (args.Length == 0)
         writer.Write(format);
     else
         writer.Write(string.Format(cultureInfo, format, args));
 }
コード例 #4
0
 public void Write(BenchmarkLogKind logKind, string format, params object[] args)
 {
     var s = string.Format(EnvironmentInfo.MainCultureInfo, format, args).AddPrefixMultiline(Prefix);
     if (!isNewLine)
         s = s.Remove(0, Prefix.Length);
     Logger.Write(logKind, s);
     isNewLine = s.EndsWith("\n");
 }
コード例 #5
0
 public void Write(BenchmarkLogKind logKind, string format, params object[] args)
 {
     Console.ForegroundColor = GetColor(logKind);
     if (args.Length == 0)
         Console.Write(format);
     else
         Console.Write(string.Format(cultureInfo, format, args));
     Console.ForegroundColor = DefaultColor;
 }
コード例 #6
0
 public void Write(BenchmarkLogKind logKind, string format, params object[] args)
 {
     if (args.Length == 0)
     {
         writer.Write(format);
     }
     else
     {
         writer.Write(string.Format(cultureInfo, format, args));
     }
 }
コード例 #7
0
 public void Write(BenchmarkLogKind logKind, string format, params object[] args)
 {
     Console.ForegroundColor = GetColor(logKind);
     if (args.Length == 0)
     {
         Console.Write(format);
     }
     else
     {
         Console.Write(string.Format(cultureInfo, format, args));
     }
     Console.ForegroundColor = DefaultColor;
 }
コード例 #8
0
 private ConsoleColor GetColor(BenchmarkLogKind logKind)
 {
     return colorScheme.ContainsKey(logKind) ? colorScheme[logKind] : DefaultColor;
 }
コード例 #9
0
 public void Write(BenchmarkLogKind logKind, string format, params object[] args)
 {
     foreach (var logger in loggers)
         logger.Write(logKind, format, args);
 }
コード例 #10
0
ファイル: FctbLogger.cs プロジェクト: nus-ii/BenchmarkDotNet
 public void Write(BenchmarkLogKind logKind, string format, params object[] args)
 {
     textBox.Invoke(new Action(() => TextBoxWrite(logKind, format, args)));
 }
コード例 #11
0
 public void Write(BenchmarkLogKind logKind, string format, params object[] args)
 {
     builder.Append(string.Format(CultureInfo.InvariantCulture, format, args));
 }
コード例 #12
0
 public static void WriteLine(this IBenchmarkLogger logger, BenchmarkLogKind logKind, string format, params object[] args)
 {
     logger.Write(logKind, (format ?? string.Empty) + Environment.NewLine, args);
 }
コード例 #13
0
 public static void WriteLine(this IBenchmarkLogger logger, BenchmarkLogKind logKind, string format, params object[] args)
 {
     logger.Write(logKind, (format ?? string.Empty) + Environment.NewLine, args);
 }
コード例 #14
0
 private ConsoleColor GetColor(BenchmarkLogKind logKind)
 {
     return(colorScheme.ContainsKey(logKind) ? colorScheme[logKind] : DefaultColor);
 }
コード例 #15
0
 public void Write(BenchmarkLogKind logKind, string format, params object[] args)
 {
     builder.Append(string.Format(CultureInfo.InvariantCulture, format, args));
 }
コード例 #16
0
 public void Write(BenchmarkLogKind logKind, string format, params object[] args)
 {
     writer.Write(string.Format(cultureInfo, format, args));
 }