Skip to content

Commit

Permalink
transform component detection warnings into information because they …
Browse files Browse the repository at this point in the history
…are rather frequent
  • Loading branch information
baronfel committed Feb 27, 2025
1 parent 65ef5ea commit 71efc73
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Microsoft.Sbom.Targets/MSBuildLogger.cs
Original file line number Diff line number Diff line change
@@ -29,6 +29,12 @@ public MSBuildLogger(TaskLoggingHelper loggingHelperToWrap)
public void Write(LogEvent logEvent)
{
var logLevel = logEvent.Level;
if (logLevel is LogEventLevel.Warning && logEvent.Properties["SourceContext"].ToString().StartsWith("Microsoft.ComponentDetection.Detectors", StringComparison.Ordinal))
{
// Component Detection fires a lot of warnings, translate these to Information
logLevel = LogEventLevel.Information;
}

switch (logLevel)
{
case LogEventLevel.Debug:

0 comments on commit 71efc73

Please sign in to comment.