-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Fix up code snippets and descriptions #51524
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
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 addresses Issue #41327 by fixing code snippets and improving descriptions in the custom logging provider documentation. The main issue was that the documentation contained unexplained code fragments (specifically parameter lines from a method signature) that confused readers.
Changes:
- Replaced the meaningless code snippet showing parameter fragments with a proper snippet reference that demonstrates the IsEnabled check pattern
- Improved heading hierarchy by promoting subsections from H3 to H2 for better document structure
- Enhanced clarity in various descriptions and converted text to be more conversational and aligned with Microsoft's documentation style guidelines
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| docs/core/extensions/snippets/configuration/console-custom-logging/ColorConsoleLogger.cs | Added snippet markers around the IsEnabled check for better code reuse in documentation |
| docs/core/extensions/logging/custom-provider.md | Fixed code snippet references, improved heading structure, enhanced descriptive text, added tables for better visual clarity, and updated metadata date |
Comments suppressed due to low confidence (1)
docs/core/extensions/logging/custom-provider.md:58
- The highlight now only emphasizes line 7 (ProviderAlias attribute), but the explanatory text on lines 57-58 describes both the UnsupportedOSPlatform attribute (line 6) and the ProviderAlias attribute (line 7). Consider highlighting both lines 6-7 to match the text, or adjust the text to focus primarily on the ProviderAlias attribute.
:::code language="csharp" source="../snippets/configuration/console-custom-logging/ColorConsoleLoggerProvider.cs" range="6-8" highlight="7":::
The `ColorConsoleLoggerProvider` class defines two class-scoped attributes:
- <xref:System.Runtime.Versioning.UnsupportedOSPlatformAttribute>: The `ColorConsoleLogger` type is _not supported_ in the `"browser"`.
- <xref:Microsoft.Extensions.Logging.ProviderAliasAttribute>: Configuration sections can define options using the `"ColorConsole"` key.
docs/core/extensions/snippets/configuration/console-custom-logging/ColorConsoleLogger.cs
Outdated
Show resolved
Hide resolved
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
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
docs/core/extensions/logging/custom-provider.md:85
- According to markdown style guidelines, the title should be in sentence case. "app" should be lowercase rather than uppercase "App" to follow the guideline of capitalizing only the first word and proper nouns in headings and text.
- [Dependency injection in .NET](../dependency-injection/overview.md)
BillWagner
left a comment
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.
This LGTM @gewarren
Let's ![]()
Contributes to #41327 (fragments left in document).
Internal previews