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...");