Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code cleanups and improvements #1713

Merged
merged 10 commits into from
Feb 4, 2023
Prev Previous commit
Next Next commit
Reduce verbosity when Options.Quiet is set.
  • Loading branch information
tritao committed Feb 4, 2023
commit 47910c9f1cd801d30be25b3fed9682d9e33f4559
1 change: 0 additions & 1 deletion src/Generator.Tests/GeneratorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public virtual void Setup(Driver driver)
testModule.LibraryDirs.Add(options.OutputDir);
testModule.Libraries.Add($"{name}.Native");

Diagnostics.Message("Looking for tests in: {0}", path);
var files = Directory.EnumerateFiles(path, "*.h", SearchOption.AllDirectories);
foreach (var file in files)
{
Expand Down
6 changes: 4 additions & 2 deletions src/Generator/Driver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ void OnFileParsed(IEnumerable<string> files, ParserResult result)
switch (result.Kind)
{
case ParserResultKind.Success:
Diagnostics.Message("Parsed '{0}'", string.Join(", ", files));
if (!Options.Quiet)
Diagnostics.Message("Parsed '{0}'", string.Join(", ", files));
break;
case ParserResultKind.Error:
Diagnostics.Error("Error parsing '{0}'", string.Join(", ", files));
Expand Down Expand Up @@ -346,7 +347,8 @@ public void SaveCode(IEnumerable<GeneratorOutput> outputs)

output.TranslationUnit.Module?.CodeFiles.Add(file);

Diagnostics.Message("Generated '{0}'", fileRelativePath);
if (!Options.Quiet)
Diagnostics.Message("Generated '{0}'", fileRelativePath);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Generator/Passes/CheckAmbiguousFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public override bool VisitFunctionDecl(AST.Function function)
}

if (function.IsAmbiguous)
Diagnostics.Message($"Found ambiguous overload: {function.QualifiedOriginalName}");
Diagnostics.Debug($"Found ambiguous overload: {function.QualifiedOriginalName}");

return true;
}
Expand Down