Skip to content

feat: use Microsoft.Extensions.Logging.ILogger - #758

Merged
Deadpikle merged 2 commits into
NetSparkleUpdater:developfrom
bdovaz:use-microsoft-ilogger
Nov 25, 2026
Merged

Deadpikle merged 2 commits into
NetSparkleUpdater:developfrom
bdovaz:use-microsoft-ilogger

Conversation

@bdovaz

@bdovaz bdovaz commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

The problem with custom Sparkle logging was that it wasn't enough:

  • It doesn't have log levels
  • It doesn't log exceptions
  • The provider (== output) isn't additive; with Microsoft's, you can have N
  • It isn't structured

Today, the de facto standard is to use Microsoft's ILogger.

Microsoft provides many services that allow users to choose which ones to use through separate NuGet packages:

https://learn.microsoft.com/en-us/dotnet/core/extensions/logging/providers

For even more advanced cases there are many NuGet packages—logging frameworks other than Microsoft's—that are also built on top of it.

Here's what I've done:
• Replaces NetSparkle’s custom logger with Microsoft.Extensions.Logging.ILogger.
• Removes LogWriter and the custom logging interfaces and options.
• Leaves logging provider configuration to the application.
• Renames LogWriter-related properties to Logger and documents this breaking change in UPGRADING.md.
• Updates samples and tests, and upgrades Microsoft.Extensions.Logging.Abstractions to 10.0.15.
• Improves logging with structured message templates, exception details, and appropriate log levels; removes redundant level and category prefixes.

More information: https://learn.microsoft.com/en-us/dotnet/core/extensions/logging/overview?tabs=command-line

@Deadpikle

Deadpikle commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Looks good to me in principle. Great change/addition.

What do you think about adding a link to UPGRADING.md to https://learn.microsoft.com/en-us/dotnet/core/extensions/logging/console-log-formatter (or similar) so people can get a quick look at how to re-add a simple console-based logger to their app? And then maybe setting up one of the samples to do the same so there's a practical example? And/or maybe some links to Serilog or similar. I want to try to reduce friction to upgrading if possible.

@bdovaz

bdovaz commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Done! I've added examples to both the WinForms and WPF samples.

@Deadpikle

Copy link
Copy Markdown
Member

Thanks much!

@Deadpikle
Deadpikle merged commit 7c06a6b into NetSparkleUpdater:develop Nov 25, 2026
5 checks passed
@bdovaz
bdovaz deleted the use-microsoft-ilogger branch November 25, 2026 11:36
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.

2 participants