From d63ef03200d2b1af6956f2f887f8e8012fd08fd7 Mon Sep 17 00:00:00 2001 From: marcos henrich Date: Wed, 16 Apr 2014 16:11:22 +0100 Subject: [PATCH] Changed Driver.Diagnostics setter to public. Replaced TextDiagnosticPrinter Verbose field by Level. --- src/Core/Diagnostics.cs | 5 +++-- src/Generator/Driver.cs | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Core/Diagnostics.cs b/src/Core/Diagnostics.cs index 302d6229..a33c8b3f 100644 --- a/src/Core/Diagnostics.cs +++ b/src/Core/Diagnostics.cs @@ -143,17 +143,18 @@ namespace CppSharp public class TextDiagnosticPrinter : IDiagnosticConsumer { - public bool Verbose; public Stack Indents; + public DiagnosticKind Level; public TextDiagnosticPrinter() { Indents = new Stack(); + Level = DiagnosticKind.Message; } public void Emit(DiagnosticInfo info) { - if (info.Kind == DiagnosticKind.Debug && !Verbose) + if (info.Kind < Level) return; var currentIndent = Indents.Sum(); diff --git a/src/Generator/Driver.cs b/src/Generator/Driver.cs index 7c69cee7..b37f67fd 100644 --- a/src/Generator/Driver.cs +++ b/src/Generator/Driver.cs @@ -21,8 +21,9 @@ namespace CppSharp { public class Driver { + public IDiagnosticConsumer Diagnostics { get; set; } + public DriverOptions Options { get; private set; } - public IDiagnosticConsumer Diagnostics { get; private set; } public Project Project { get; private set; } public TypeMapDatabase TypeDatabase { get; private set; } @@ -421,7 +422,8 @@ namespace CppSharp library.Setup(driver); driver.Setup(); - Log.Verbose = driver.Options.Verbose; + if(driver.Options.Verbose) + Log.Level = DiagnosticKind.Debug; if (!options.Quiet) Log.EmitMessage("Parsing libraries...");