public void Publish(ReportSeverity reportSeverity) { // If we need a new line then add it. OtherUtils.ConsoleGotoNewLine(); // Give errors or warnings in standard form. var ttb = new TitledTextBuilder(); ttb.Append(_reportTitles[reportSeverity], _genreDescriptions[this.ReportGenre]); // If given, write reason. if (!this.Reason.IsNullOrEmpty()) { ttb.Append("Reason", this.Reason); } // If given, write location. if (!this.Location.IsNullOrEmpty()) { ttb.Append("Location", this.Location); } if (reportSeverity == ReportSeverity.Error) { Console.Error.WriteLine($"\n{ttb}"); } else { Console.Write($"\n{ttb}"); } }
public static void Message(string title, string text) { if (Verbose < 3) { return; } var ttb = new TitledTextBuilder(); ttb.Append(title, text); OtherUtils.ConsoleGotoNewLine(); Console.Write(ttb.ToString()); }