Open gustavoaca1997 opened 4 months ago
This issue is a major detriment for using the msbuild tasks as it prints a bunch of extra info and clutters the log and console. It also seems to print this messy table to the console, but that seems to be controlled separate from the logging level.
The core of the issue seems to be with the Microsoft.Sbom.Extensions.DependencyInjection.ServiceCollectionExtensions.AddSbomTool() which takes in a Serilog LogEventLevel which by default is set to the information level. There is also the AddSbomConfiguration
method but that doesn't seem to be used in the tools currently.
The two uses of the AddSbomTool
method in Microsoft.Sbom.Targets.GenerateSbom and Microsoft.Sbom.Tool.Program do not pass a log level value to the method. So I can only guess that is the cause for the verbosity level on the command line or the msbuild task always being information level.
I'm not familiar enough with the use of IHost
and this tool's architecture to come up with a solution, but just hard coding the log level to warning in the AddSbomTool
calls at least stops printing the information level messages. This proves the likelihood that this is the cause of the underlying issue.
The table shown above is still being printed and I haven't been able to track down where that is being generated in the code.
Even though we are setting the verbosity to values like Warning, Fatal or Error, we still see the
information
logs: