Skip to content

Improve logging from agent - #43672

Merged
tmat merged 3 commits into
dotnet:release/9.0.1xxfrom
tmat:AgentLogging
Sep 30, 2024
Merged

tmat merged 3 commits into
dotnet:release/9.0.1xxfrom
tmat:AgentLogging

Conversation

@tmat

@tmat tmat commented Sep 24, 2024 •

Copy link
Copy Markdown
Member

Currently the agent only logs to std out, which is redirected by apps (e.g. asp.net). It also doesn't consider output verbosity of dotnet-watch.
Instead of logging via stdout we now send log messages back to the dotnet-watch pipe, so that dotnet-watch can report them in the same way it does other messages.

Also refactors and cleans up the agent implementation.

Implements #43323.

@tmat
tmat requested review from a team and arunchndr as code owners September 24, 2024 22:06
@ghost ghost added Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, StaticWebAssetsSDK untriaged Request triage from a team member labels Sep 24, 2024
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @tmat.
To learn about the PR process and branching schedule of this repo, please take a look at the SDK PR Guide.

public HotReloadAgent(Action<string> log)
public HotReloadAgent(NamedPipeClientStream pipeClient, Action<string> stdOutLog)
{
var metadataUpdater = Type.GetType("System.Reflection.Metadata.MetadataUpdater, System.Runtime.Loader", throwOnError: false);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to GetUpdaterMethods.

}
}

internal sealed class UpdateHandlerActions

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to MetadataUpdateHandlerInvoker.

/// <summary>
/// Internal for testing.
/// </summary>
internal RegisteredActions GetMetadataUpdateHandlerActions(IEnumerable<Type> handlerTypes)

@tmat tmat Sep 24, 2024 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just moved and refactored.

@tmat

tmat commented Sep 24, 2024

Copy link
Copy Markdown
Member Author

@phil-allen-msft PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, StaticWebAssetsSDK untriaged Request triage from a team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants