dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.27k stars 4.74k forks source link

Add a way to produce diagnostics log from Microsoft.NET.HostModel #53923

Open vitek-karas opened 3 years ago

vitek-karas commented 3 years ago

Basically the only user of Microsoft.NET.HostModel is the SDK and some of its tasks. So it's almost always running in the context of MSBuild with its relatively rich logging/diagnostics capabilities. But we're not using any of that because we build the Microsoft.NET.HostModel as a standalone library. That in itself is not a problem, but it would make a lot of sense to introduce a logging interface into the library so that it can produce diagnostics into the parent MSBuild if we task chooses to pass it through.

Currently we have very little visibility into what's happing within the library unless we can directly debug it (which in itself is tricky when it's running in MSBuild).

ghost commented 3 years ago

Tagging subscribers to this area: @vitek-karas, @agocke See info in area-owners.md if you want to be subscribed.

Issue Details
Basically the only user of `Microsoft.NET.HostModel` is the SDK and some of its tasks. So it's almost always running in the context of MSBuild with its relatively rich logging/diagnostics capabilities. But we're not using any of that because we build the `Microsoft.NET.HostModel` as a standalone library. That in itself is not a problem, but it would make a lot of sense to introduce a logging interface into the library so that it can produce diagnostics into the parent MSBuild if we task chooses to pass it through. Currently we have very little visibility into what's happing within the library unless we can directly debug it (which in itself is tricky when it's running in MSBuild).
Author: vitek-karas
Assignees: -
Labels: `area-HostModel`
Milestone: -
mateoatr commented 3 years ago

I think we could start by using the tracing mechanism that is used today by the bundler and add the necessary knobs in the SDK (similar to TraceSingleFileBundler).