Skip to content

refactor: route host diagnostics through ILogger - #986

Merged
albertospelta merged 1 commit into
mainfrom
refactor/diagnostics-through-ilogger
Oct 22, 2026
Merged

albertospelta merged 1 commit into
mainfrom
refactor/diagnostics-through-ilogger

Conversation

@albertospelta

@albertospelta albertospelta commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Every AppEnvironment.AddDiagnostics call is now a [LoggerMessage] method;
static call sites log in their caller or take an ILogger. AddDiagnostics,
IsDiagnosticLevelVerbose, AppEnvironment.Diagnostics and DiagnosticMessage
are removed.

DiagnosticLevelSwitch carries the user's diagnostic level into a logger filter
rule: the pane store receives Information only at Verbose, while Microsoft and
System categories stay at Warning. The bootstrap applies the saved level and
UpdateOptions applies a changed one after every save attempt.

DiagnosticLogStore keeps the last 1000 records, bounded by text size too,
with template, placeholder values and the exception chain (aggregate inners
and the properties each exception type adds). GetDiagnostics takes a cursor
and a maximum count instead of marking records as read, so a reload of the
pane loses no host record. The pane polls at every level except None, shows
JSON values as a tree and highlights records with an exception.

The catch-all problem details mapping no longer logs, since the middleware
logs 500 responses; mapped exceptions are logged and tracked through one
method. The per-message copy redacts the same five sensitive tags as
telemetry, and a test keeps the two tag lists aligned.

@albertospelta
albertospelta force-pushed the refactor/diagnostics-through-ilogger branch 2 times, most recently from d242ebd to 083ed8c Compare October 21, 2026 23:07
@albertospelta albertospelta changed the title refactor: route host diagnostics through ILogger and a bounded store refactor: route host diagnostics through ILogger Oct 21, 2026
@albertospelta
albertospelta marked this pull request as ready for review October 21, 2026 23:09
@albertospelta
albertospelta force-pushed the refactor/diagnostics-through-ilogger branch from 083ed8c to 17a9a86 Compare October 21, 2026 23:52
Every AppEnvironment.AddDiagnostics call is now a [LoggerMessage] method;
static call sites log in their caller or take an ILogger. AddDiagnostics,
IsDiagnosticLevelVerbose, AppEnvironment.Diagnostics and DiagnosticMessage
are removed.

DiagnosticLevelSwitch carries the user's diagnostic level into a logger filter
rule: the pane store receives Information only at Verbose, while Microsoft and
System categories stay at Warning. The bootstrap applies the saved level and
UpdateOptions applies a changed one after every save attempt.

DiagnosticLogStore keeps the last 1000 records, bounded by text size too,
with template, placeholder values and the exception chain (aggregate inners
and the properties each exception type adds). GetDiagnostics takes a cursor
and a maximum count instead of marking records as read, so a reload of the
pane loses no host record. The pane polls at every level except None, shows
JSON values as a tree and highlights records with an exception.

The catch-all problem details mapping no longer logs, since the middleware
logs 500 responses; mapped exceptions are logged and tracked through one
method. The per-message copy redacts the same five sensitive tags as
telemetry, and a test keeps the two tag lists aligned.
@albertospelta
albertospelta force-pushed the refactor/diagnostics-through-ilogger branch from 17a9a86 to 65dc02d Compare October 21, 2026 23:59
@albertospelta
albertospelta merged commit 453be87 into main Oct 22, 2026
1 check passed
@albertospelta
albertospelta deleted the refactor/diagnostics-through-ilogger branch October 22, 2026 00:03
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.

1 participant