public static void Debug(this IDiagnosticConsumer consumer, DiagnosticId id, string msg, params object[] args) { var diagInfo = new DiagnosticInfo { Kind = DiagnosticKind.Debug, Message = string.Format(msg, args) }; consumer.Emit(diagInfo); }
public static void Error(this IDiagnostics consumer, string msg, params object[] args) { var diagInfo = new DiagnosticInfo { Kind = DiagnosticKind.Error, Message = string.Format(msg, args) }; consumer.Emit(diagInfo); }
public void Emit(DiagnosticInfo info) { Console.WriteLine(info.Message); System.Diagnostics.Debug.WriteLine(info.Message); }
public static void EmitError(this IDiagnosticConsumer consumer, string msg) { var diagInfo = new DiagnosticInfo { Kind = DiagnosticKind.Error, Message = msg }; consumer.Emit(diagInfo); }
public void Emit(DiagnosticInfo info) { if (info.Kind == DiagnosticKind.Debug && !Verbose) return; var currentIndent = Indents.Sum(); var message = new string(' ', currentIndent) + info.Message; Console.WriteLine(message); Debug.WriteLine(message); }