-
Notifications
You must be signed in to change notification settings - Fork 2
Add structured logging using Microsoft.Extensions.Logging #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit introduces logging functionality across multiple classes, replacing console output with `ILogger` calls. Key changes include: - Updated `CloneTemplateAsync` in `ITemplateService` to accept an optional `ILogger` parameter. - Modified `DefaultContainerExtension` and `DefaultContainerRenderer` to support logging. - Enhanced `SafeContainerParser` to log debug information during parsing. - Updated `Blake.MarkdownParser.csproj` to include a reference to `Microsoft.Extensions.Logging.Abstractions`. These changes improve the maintainability and debuggability of the codebase.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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 introduces structured logging using Microsoft.Extensions.Logging to replace console output throughout the Blake markdown parser and build tools. The change improves maintainability and debuggability by providing a consistent logging framework with configurable log levels.
Key changes include:
- Replaced Console.WriteLine statements with structured ILogger calls across multiple classes
- Added optional ILogger parameters to methods and constructors throughout the codebase
- Added Microsoft.Extensions.Logging.Abstractions package reference
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| SafeContainerParser.cs | Replaced console debug output with structured logging using LogDebug |
| MarkdigExtensions.cs | Added optional logger parameter to SetupContainerRenderers method |
| DefaultContainerRenderer.cs | Replaced Debug.WriteLine with structured logging and updated constructor |
| DefaultContainerExtension.cs | Added logger parameter threading through parser and renderer instantiation |
| Blake.MarkdownParser.csproj | Added Microsoft.Extensions.Logging.Abstractions package dependency |
| PluginLoader.cs | Replaced console output with structured logging for plugin loading operations |
| TemplateService.cs | Added logger parameter to CloneTemplateAsync and replaced console output |
| ITemplateService.cs | Updated interface to include optional logger parameter |
| SiteGenerator.cs | Updated method calls to pass logger parameters |
| SampleContentBuilder.cs | Replaced console output with structured logging for sample content creation |
| ProjectFileBuilder.cs | Replaced console output with structured logging for project file operations |
Comments suppressed due to low confidence (1)
src/Blake.MarkdownParser/Blake.MarkdownParser.csproj:38
- Microsoft.Extensions.Logging.Abstractions version 9.0.7 may not exist. As of January 2025, the latest version is 8.0.0. Please verify this version exists or use a confirmed available version.
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.7" />
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
This commit introduces logging functionality across multiple classes, replacing console output with
ILoggercalls. Key changes include:CloneTemplateAsyncinITemplateServiceto accept an optionalILoggerparameter.DefaultContainerExtensionandDefaultContainerRendererto support logging.SafeContainerParserto log debug information during parsing.Blake.MarkdownParser.csprojto include a reference toMicrosoft.Extensions.Logging.Abstractions.These changes improve the maintainability and debuggability of the codebase.
🧷 This PR will be released as a preview by default.
To trigger a stable release:
previewlabelreleaselabelSemver-MinororSemver-Majorto control version bump🏷️ Add labels to control release notes:
enhancement,bug,breaking-change,dependenciesignore-for-releaseto suppress it from notes