-
Notifications
You must be signed in to change notification settings - Fork 616
Complete logging migration from static Log.* to ILogger<T> dependency injection #177
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copilot
AI
changed the title
[WIP] Migrate Log.Debug() calls to ILogger pattern
Logging Migration Status Verification: Ticket #2 (Bulk Migration) Not Implemented
Feb 6, 2026
Contributor
|
@copilot Take a look at the start on the changes and finish the refactoring.. |
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- Added using Microsoft.Extensions.Logging - Added ILogger<AnimationPlayer> field - Initialized logger using LoggingConfiguration.CreateLogger<AnimationPlayer>() - Converted 107 Log method calls: * 100 Log.Verbose → _logger.LogTrace * 7 Log.Exception → _logger.LogError * 5 Log.Audit left unchanged (not part of logging migration) Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- Added using Microsoft.Extensions.Logging - Added static ILogger<AgentManager> field - Added SetLogger method for initialization - Converted 79 Log calls: - 51 Log.Debug → _logger?.LogDebug - 22 Log.Verbose → _logger?.LogTrace - 5 Log.Exception → _logger?.LogError - 1 Log.Warn → _logger?.LogWarning Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- Changed empty string LogTrace calls to use method names - Makes logs more informative and useful for debugging Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- Replaced all Log.Debug() calls with _logger?.LogDebug() - Replaced all Log.Error() calls with _logger?.LogError() - Replaced all Log.Warn() calls with _logger?.LogWarning() - Replaced all Log.Exception() calls with _logger?.LogError(ex, ...) - Replaced all Log.Verbose() calls with _logger?.LogTrace() - Replaced all Log.IsNull() calls with _logger?.LogDebug() with null check logic - Logger field and constructor injection were already in place - Converted 68 logging calls total Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- Converted all Log.Debug() to _logger.LogDebug() - Converted all Log.Error() to _logger.LogError() - Converted all Log.Exception(ex) to _logger.LogError(ex, ex.Message) - Converted Log.Verbose() to _logger.LogTrace() - Applied structured logging with named parameters - Converted string concatenation to template-based logging Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- Fixed typo: AutoCOmpleteCaretPos → AutoCompleteCaretPos - Enhanced LogTrace message to include punctuation parameter Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
…ging - Initialize ILogger<OpenBCIDeviceTester> in constructor - Convert all 28 Log.Debug/Error/Exception calls to structured logging - Apply structured logging with message templates and parameters - Improve log message clarity and consistency Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Copilot
AI
changed the title
Logging Migration Status Verification: Ticket #2 (Bulk Migration) Not Implemented
Complete logging migration from static Log.* to ILogger<T> dependency injection
Feb 8, 2026
Refactored logger initialization across the codebase to use LoggingConfiguration.CreateLogger<T>() or CreateLogger("TypeName"), replacing direct LoggerFactory and LogManager usage. Introduced static loggers for use in static contexts. Updated constructors and method calls to consistently inject logger instances. Ensured all widgets and key classes receive logger dependencies. Minor typo fixes included. These changes improve logging consistency, maintainability, and configurability throughout the application.
Refactored constructors in handler and utility classes to accept optional ILogger parameters, defaulting to LoggingConfiguration.CreateLogger<T>() when not provided. Removed redundant log trace calls from lifecycle methods to reduce log noise. Updated ACATAgentBase to pass logger to base and removed its own logger field. Fixed minor typos in comments and improved error handling and logging in word prediction response processing. These changes streamline logger management and improve code clarity.
Standardize logger initialization using LoggingConfiguration. Update constructors to accept logger parameters; pass null where needed. Rename Utils.HandleHelpNavigaion to HandleHelpNavigation. Improve exception handling and logging statements. Refactor agent classes to use base class logging. Fix minor typos and comments for clarity.
Major architectural update introducing dependency injection (DI) and centralized logging across ACAT. All extension and manager singletons are now lazily initialized and DI-friendly, with loggers provided via DI or a new LogManager. Extension instantiation uses DI where possible, improving modularity and testability. Application startup now configures DI and logging before any managers/extensions are created. Logging is consistent and robust throughout, and error handling is improved. This modernizes the codebase for maintainability and future extensibility.
michaelbeale-IL
approved these changes
Feb 10, 2026
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Completes the logging refactoring started in #178. Migrates all remaining production code from static
Log.Debug/Error/Info/Exceptioncalls to Microsoft.Extensions.LoggingILogger<T>pattern with structured logging.Scope
Changes
Pattern Applied
Conversion Mapping
Log.Debug(msg)→_logger.LogDebug(msg)Log.Error(msg)→_logger.LogError(msg)Log.Info(msg)→_logger.LogInformation(msg)Log.Exception(ex)→_logger.LogError(ex, ex.Message)Log.Verbose(msg)→_logger.LogTrace(msg)Structured Logging
String concatenation replaced with template parameters throughout:
"Value: " + count→"Value: {Count}", countMajor Files Converted
TextController.cs(34 calls)CameraActuator.cs(29 calls)PanelAnimationManager.cs(28 calls)OpenBCIDeviceTester.cs(28 calls)DecisionMaker.cs(26 calls)UserControlAnimationManager.cs(26 calls)Verification
Original prompt
This section details on the original issue you should resolve
<issue_title>[2] AI-Assisted Log.Debug() to ILogger Migration</issue_title>
<issue_description>Estimate: 2 days
Sprint: Week 1
Assignee: [Developer]
Description
Use AI to find and replace all
Log.Debug()calls with modernILogger<T>pattern across the entire codebase. This is the bulk conversion work.Context
AI Prompt
Manual Tasks
Acceptance Criteria
Log.Debug()calls replaced with_logger.LogDebug()Log.Error()calls replaced with_logger.LogError()ILogger<T>injectedLog.Debug(in codebase (verified by search)Example Conversion
Validation Script
Dependencies
Notes
Log.csfile temporarily for reference[Obsolete]attribute initially🎫 Ticket #3: Update Application Entry Points with Logging DI
Labels:
phase-1-foundation,logging,P1-High,setupEstimate: 1 day
Assignee: [Developer]
Sprint: Week 1
Description
Update all application entry points (Program.cs, WinForms startup) to configure dependency injection and logging services. This makes ILogger available throughout the application.
Context
Tasks
ServiceConfiguration.cshelper class💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.