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

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>
CopilotAI review requested due to automatic review settings January 30, 2026 17:11
@ptr727
ptr727 enabled auto-merge (squash) January 30, 2026 17:12

CopilotAI 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
FileDescription
Library/LogOptions.csNew global logging configuration with thread-safe static factory and logger properties
Library/Options.csNew options class for per-instance logger configuration
Library/Library.csRefactored to use new LogOptions system; added StaticTemplateLibrary class
Library/Extensions.csChanged extension method visibility from public to internal
Library/Library.csprojRemoved Husky build target (now managed via dotnet tool)
Tests/Tests.csprojUpgraded from xUnit v2.9.3 to xUnit v3.2.2
Tests/LoggingTests.csNew comprehensive test suite for logging framework (205 lines)
Tests/SampleTest.csImproved test naming and added xUnit v3 TestContext cancellation token usage
Tests/Fixture.csAdded AssemblyFixture and sequential collection support for shared test state
Tests/GlobalUsings.csRemoved unused System.IO import
Tests/.editorconfigAdded suppressions for missing XML docs and CA1515
Console/Program.csUpdated to use new LogOptions.SetFactory for global logger configuration
Console/LoggerFactory.csReordered members and added CreateLoggerFactory method
Console/CommandLine.csReordered members (fields to top, nested Options class to bottom)
Console/Extensions.csReordered LogOverride class to bottom, removed redundant suppressions
Console/GlobalUsings.csAdded Microsoft.Extensions.Logging and Serilog.Events
Console/.editorconfigUpdated comment from TODO to descriptive explanation
Console/Console.csprojRemoved Husky target and SourceLink package
CodeGen/HttpClientFactory.csFixed ShouldHandle to handle exceptions; reordered members
CodeGen/CommandLine.csReordered members to follow conventions
CodeGen/CodeGen.csprojRemoved Husky target and SourceLink package
CodeGen/.editorconfigUpdated comment from TODO to descriptive explanation
Benchmarks/SampleBenchmark.csConverted #pragma suppressions to SuppressMessage attributes
Benchmarks/.editorconfigAdded suppression for missing XML docs
CODESTYLE.mdNew comprehensive style guide (296 lines)
AGENTS.mdNew AI agent instructions (61 lines)
.github/copilot-instructions.mdEnhanced with additional documentation and reference links
.editorconfigWhitespace cleanup
.config/dotnet-tools.jsonAdded newline at end of file

Comment thread.github/copilot-instructions.md
Comment threadTests/SampleTest.cs
Comment threadCODESTYLE.md
Comment threadAGENTS.md
@ptr727
ptr727 merged commit 36aa95e into developJan 30, 2026
25 checks passed
Sign up for freeto 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

@ptr727