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

Use MSBuild Logging APIs for Task output instead of StdOut #933

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix rewriting detection
  • Loading branch information
baronfel committed Mar 1, 2025
commit aa37566d5b2a3fbaedcea5d0d4689016cd5a8bce
2 changes: 1 addition & 1 deletion src/Microsoft.Sbom.Targets/MSBuildLogger.cs
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ 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", StringComparison.Ordinal))
if (logLevel is LogEventLevel.Warning && logEvent.Properties["SourceContext"] is ScalarValue sv && sv.Value is string svv && svv.StartsWith("Microsoft.ComponentDetection", StringComparison.Ordinal))
{
// Component Detection fires a lot of warnings, translate these to Information
logLevel = LogEventLevel.Information;