Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 10, 2026

  • Explore repository structure and understand current logging implementation
  • Identify all places using ILogger
  • Create generic Log class with source-generated logging methods
  • Register Log as singleton in DI container in Program.cs
  • Update DesBruteForceDecryptionService to use Log
  • Update DesDecryptServices to use Log
  • Update DesEncryptServices to use Log
  • Build and verify all CA1848 and CA1727 warnings are resolved
  • Test the application to ensure logging works correctly
  • Reorganize EventIds by log level and operation type (Debug: 10000+, Info: 1000+, Error: 100+)
  • Reorder DI registrations in Program.cs
Original prompt

Let's use source generated logging. Register a singleton generic logger Log in DI and use it to hold logs for the Api project.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: aannenko <4640265+aannenko@users.noreply.github.com>
Copilot AI changed the title [WIP] Add generic logger Log<T> to the Api project Implement source-generated logging with generic Log<T> singleton Jan 10, 2026
Copilot AI requested a review from aannenko January 10, 2026 08:29
@aannenko
Copy link
Owner

@copilot In the new Log.cs, replace event ids so that error-level logs were in hundreds range, e.g. 100, 101, 102, 103 .. 199 for decryption, 200, 201 .. 299 for encryption. Make information log event ids in thousands range, e.g. 1000, 1001 ... 1999 for decryption and 2000, 2001 .. 2999 for encryption. Make debug-level logs have 5 digits, e.g. 10000, 10001 .. 19999 for decryption and 20000, 20001 .. 29999 for encryption.

- Debug: 10000-19999 (decryption), 20000-29999 (encryption)
- Information: 1000-1999 (decryption), 2000-2999 (encryption)
- Error: 100-199 (decryption), 200-299 (encryption)

Co-authored-by: aannenko <4640265+aannenko@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 10, 2026

@copilot In the new Log.cs, replace event ids so that error-level logs were in hundreds range, e.g. 100, 101, 102, 103 .. 199 for decryption, 200, 201 .. 299 for encryption. Make information log event...

Done in d7b89a1. EventIds reorganized:

  • Debug: 10000-10003 (decryption)
  • Information: 1000-1003 (decryption), 2000-2001 (encryption)
  • Error: 100 (decryption), 200 (encryption)

@aannenko
Copy link
Owner

@copilot src/CrackSharp.Api/Program.cs:18 Move this line one line up.

Co-authored-by: aannenko <4640265+aannenko@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 10, 2026

@copilot src/CrackSharp.Api/Program.cs:18 Move this line one line up.

Done in 25d3443. Log<> registration now appears before AddMemoryCache.

@aannenko aannenko marked this pull request as ready for review January 10, 2026 10:50
@aannenko aannenko merged commit 19a1818 into master Jan 10, 2026
5 checks passed
@aannenko aannenko deleted the copilot/register-generic-logger branch January 10, 2026 10:53
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