Skip to content

Unify logging pattern in browser refresh middleware. - #56006

Open
tmat wants to merge 3 commits into
dotnet:mainfrom
tmat:cleanup-middleware-logs
Open

Unify logging pattern in browser refresh middleware.#56006
tmat wants to merge 3 commits into
dotnet:mainfrom
tmat:cleanup-middleware-logs

Conversation

@tmat

@tmat tmat commented Aug 28, 2026

Copy link
Copy Markdown
Member

Prefix messages with "refresh" emoji so that they stand out.

Prefix messages with "refresh" emoji so that they stand out.
Copilot AI lite review requested due to automatic review settings August 28, 2026 21:30
@tmat
tmat requested a review from a team as a code owner August 28, 2026 21:30
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates dotnet-watch’s BrowserRefreshMiddleware logging to route more messages through the existing LoggerMessage.Define pattern and prefixes those messages with a refresh symbol to make them more visually distinctive in output.

Changes:

  • Replaced constructor and header-related LogDebug calls with strongly-typed Log.* methods.
  • Prefixed multiple browser refresh middleware log messages with a refresh symbol via a shared Symbol constant.
  • Added new LoggerMessage.Define entries for missing header/environment-variable debug messages.

Comment thread src/Dotnet.Watch/Web.Middleware/BrowserRefreshMiddleware.cs
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@tmat

tmat commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

@genlu

{
private const string Symbol = "🔃";

private static readonly Action<ILogger, string?, string?, Exception?> _middlewareLoaded = LoggerMessage.Define<string?, string?>(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: put this after _scriptInjectionSkipped below to preserve the order of event ID

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants