Skip to content

Commit

Permalink
Log message when binary log is used
Browse files Browse the repository at this point in the history
  • Loading branch information
tamasvajk committed Jun 4, 2024
1 parent 6268963 commit 5f43f96
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,14 @@ public static ExitCode Run(string[] args)
var exitCode = ExitCode.Ok;
foreach (var compilerCall in compilerCalls)
{
Console.WriteLine($"Processing {compilerCall.GetDiagnosticName()}");
var diagnosticName = compilerCall.GetDiagnosticName();
Console.WriteLine($"Processing {diagnosticName}");
var compilerCallOptions = Options.CreateWithEnvironment([]);
compilerCallOptions.CompilerName = compilerCall.CompilerFilePath;
compilerCallOptions.CompilerArguments.AddRange(compilerCall.GetArguments());
var ec = Run(compilerCallOptions);
using var logger = MakeLogger(compilerCallOptions.Verbosity, compilerCallOptions.Console);
logger.LogInfo($"Running extractor on arguments from binary log. Processing {diagnosticName}.");
var ec = Run(compilerCallOptions, logger);
if (ec != ExitCode.Ok)
{
exitCode = ec;
Expand All @@ -136,19 +139,18 @@ public static ExitCode Run(string[] args)
}
else
{
return Run(options);
using var logger = MakeLogger(options.Verbosity, options.Console);
return Run(options, logger);
}
}

public static ExitCode Run(Options options)
public static ExitCode Run(Options options, ILogger logger)
{
var stopwatch = new Stopwatch();
stopwatch.Start();
var workingDirectory = Directory.GetCurrentDirectory();
var compilerArgs = options.CompilerArguments.ToArray();

using var logger = MakeLogger(options.Verbosity, options.Console);

var canonicalPathCache = CanonicalPathCache.Create(logger, 1000);
var pathTransformer = new PathTransformer(canonicalPathCache);

Expand Down

0 comments on commit 5f43f96

Please sign in to comment.