Skip to content

Refactor logging framework and enhance documentation - #22

Merged
ptr727 merged 4 commits into
developfrom
agents
Jan 30, 2026
Merged

Refactor logging framework and enhance documentation#22
ptr727 merged 4 commits into
developfrom
agents

Conversation

@ptr727

@ptr727 ptr727 commented Jan 30, 2026

Copy link
Copy Markdown
Owner

Improve the logging framework with global configuration options and refactor the code structure. Enhance documentation across multiple files and add agent instructions for better clarity.

Signed-off-by: Pieter Viljoen <ptr727@users.noreply.github.com>
Signed-off-by: Pieter Viljoen <ptr727@users.noreply.github.com>
…ve related documentation

Signed-off-by: Pieter Viljoen <ptr727@users.noreply.github.com>
…e fixture

Signed-off-by: Pieter Viljoen <ptr727@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 30, 2026 17:11
@ptr727
ptr727 enabled auto-merge (squash) January 30, 2026 17:12

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 refactors the logging framework to support global configuration and improves documentation across the project. The changes introduce a flexible logging system that allows both global static logger configuration and per-instance logger injection.

Changes:

  • Introduced a new global logging configuration system via LogOptions class with thread-safe static logger factory and fallback logger
  • Added comprehensive test coverage for the new logging framework with 150+ lines of xUnit tests
  • Upgraded from xUnit v2 to xUnit v3 and improved test naming to follow MethodName_Scenario_ExpectedBehavior convention
  • Enhanced documentation with new CODESTYLE.md and AGENTS.md files, and expanded copilot instructions
  • Improved code organization by reordering members to follow StyleCop-like conventions and converting #pragma suppressions to attributes
  • Removed redundant Husky build targets from all projects and SourceLink from non-packaged projects (Console, CodeGen)
  • Fixed resilience handler logic to properly handle both exceptions and non-success status codes

Reviewed changes

Copilot reviewed 27 out of 29 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Library/LogOptions.cs New global logging configuration with thread-safe static factory and logger properties
Library/Options.cs New options class for per-instance logger configuration
Library/Library.cs Refactored to use new LogOptions system; added StaticTemplateLibrary class
Library/Extensions.cs Changed extension method visibility from public to internal
Library/Library.csproj Removed Husky build target (now managed via dotnet tool)
Tests/Tests.csproj Upgraded from xUnit v2.9.3 to xUnit v3.2.2
Tests/LoggingTests.cs New comprehensive test suite for logging framework (205 lines)
Tests/SampleTest.cs Improved test naming and added xUnit v3 TestContext cancellation token usage
Tests/Fixture.cs Added AssemblyFixture and sequential collection support for shared test state
Tests/GlobalUsings.cs Removed unused System.IO import
Tests/.editorconfig Added suppressions for missing XML docs and CA1515
Console/Program.cs Updated to use new LogOptions.SetFactory for global logger configuration
Console/LoggerFactory.cs Reordered members and added CreateLoggerFactory method
Console/CommandLine.cs Reordered members (fields to top, nested Options class to bottom)
Console/Extensions.cs Reordered LogOverride class to bottom, removed redundant suppressions
Console/GlobalUsings.cs Added Microsoft.Extensions.Logging and Serilog.Events
Console/.editorconfig Updated comment from TODO to descriptive explanation
Console/Console.csproj Removed Husky target and SourceLink package
CodeGen/HttpClientFactory.cs Fixed ShouldHandle to handle exceptions; reordered members
CodeGen/CommandLine.cs Reordered members to follow conventions
CodeGen/CodeGen.csproj Removed Husky target and SourceLink package
CodeGen/.editorconfig Updated comment from TODO to descriptive explanation
Benchmarks/SampleBenchmark.cs Converted #pragma suppressions to SuppressMessage attributes
Benchmarks/.editorconfig Added suppression for missing XML docs
CODESTYLE.md New comprehensive style guide (296 lines)
AGENTS.md New AI agent instructions (61 lines)
.github/copilot-instructions.md Enhanced with additional documentation and reference links
.editorconfig Whitespace cleanup
.config/dotnet-tools.json Added newline at end of file

Comment thread .github/copilot-instructions.md
Comment thread Tests/SampleTest.cs
Comment thread CODESTYLE.md
Comment thread AGENTS.md
@ptr727
ptr727 merged commit 36aa95e into develop Jan 30, 2026
25 checks passed
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