-
Notifications
You must be signed in to change notification settings - Fork 616
Work in Progress on Logging Refactor. #178
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
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
b9505b5
into
copilot/migrate-log-debug-to-logger
0 of 2 checks passed
11 tasks
michaelbeale-IL
added a commit
that referenced
this pull request
Feb 10, 2026
… injection (#177) * Initial plan * Work in Progress on Logging Refactor. (#178) * Convert BCIActuator.cs to use Microsoft.Extensions.Logging Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Fix exception logging and spelling errors in BCIActuator.cs Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Fix empty LogTrace call and spelling error in BCIActuator.cs Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Adjust log severity levels based on code review Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Remove redundant exception messages from LogError calls Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Improve exception log messages and fix formatting Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Replace redundant exception messages with contextual descriptions Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Use structured logging and fix commented code Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert AnimationPlayer.cs to use Microsoft.Extensions.Logging - 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> * Convert AgentManager to Microsoft.Extensions.Logging - 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> * Improve LogTrace calls with descriptive messages - 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> * Convert PanelStack.cs to use Microsoft.Extensions.Logging - 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> * Convert DAQ_OpenBCI.cs to use Microsoft.Extensions.Logging Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert TextUtils.cs to use Microsoft.Extensions.Logging Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert ScannerCommon.cs to use Microsoft.Extensions.Logging Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert ActuatorManager.cs to use Microsoft.Extensions.Logging Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert DAQ_gTecBCI.cs to use Microsoft.Extensions.Logging Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert UserControlBCISignalCheck to use Microsoft.Extensions.Logging Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Removed unecessary verbose log messages. * Convert Log.* calls to ILogger pattern in 9 files Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Fix redundant exception logging in PreferredAgents and DimReductChanSel Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Fix redundant exception message and mark logger as NonSerialized Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Remove redundant initialization log message in PreferredAgents Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Add null check for logger in DimReductChanSel after deserialization Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert Log.* calls to ILogger in 10 ACATCore files Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert Log.* calls to ILogger pattern in 10 ACATCore files Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Use LoggingConfiguration.CreateLogger for static loggers in ProfileManager and UserManager Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Improve error message clarity in LayoutAttribute widget instantiation Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert Log.* calls to ILogger pattern in 6 files - Common.cs: Convert Log.Debug to structured logging with ILogger - DialogUtils.cs: Convert Log.Exception to LogError with exception - LaunchAppUserControl.cs: Convert Log.Info to LogInformation with structured logging - AutoCalibrateForm.cs: Convert 2 Log.Debug calls to LogDebug - Interpret.cs: Convert Log.Debug and Log.Exception to structured logging - PreferredPanelConfig.cs: Convert Log.Debug and Log.Exception to structured logging All conversions follow the modern ILogger pattern using LoggingConfiguration.CreateLogger<T>() and structured logging with message templates. Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert Log.* calls to ILogger pattern in 10 files Converted all Log.* calls to modern ILogger pattern in: - Files with 2 Log calls: Fonts.cs, PreferencesBase.cs, TextUtils.cs (already converted), WebSearch.cs - Files with 3 Log calls: FileWriter.cs, NamedPipeServerConvAssist.cs (already converted), Keyboard.cs, ExtensionInvoker.cs, Parser.cs, ColorScheme.cs Used structured logging with parameterized messages for better performance and searchability. Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert Log.* calls to ILogger pattern in 10 files - Converted 3 Log calls in FileUtils.cs - Converted 3 Log calls in TimerQueue.cs - Converted 4 Log calls in Actuators.cs - Converted 4 Log calls in WinsockServerActuatorBase.cs - Converted 4 Log calls in AgentsCache.cs - Converted 4 Log calls in KeyLogTextControlAgent.cs - Converted 4 Log calls in Animation.cs - Converted 4 Log calls in OutlineWindow.cs - Converted 4 Log calls in SpellCheckers.cs - Converted 4 Log calls in UserControlBCISignalCheck.cs All conversions use structured logging with proper parameter substitution. Added ILogger fields and Microsoft.Extensions.Logging imports where needed. Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert Log.* calls to ILogger pattern in 10 files - UserControlKeyboardCommon.cs: 4 Log calls converted - EnumWindows.cs: 4 Log calls converted (already had ILogger) - WidgetManager.cs: 4 Log calls converted (added static logger for static methods) - AlphabetScannerCommon.cs: 4 Log calls converted (already had ILogger) - DataParser.cs: 5 Log calls converted (added static logger) - gTecDeviceTester.cs: 5 Log calls converted (already had ILogger) - Abbreviations.cs: 5 Log calls converted (already had ILogger) - KeyboardActuator.cs: 5 Log calls converted (added static logger) - AnimationManager.cs: 5 Log calls converted (added static logger) - WindowHighlight.cs: 5 Log calls converted (added static logger) All conversions use structured logging with proper parameters. Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert Log.* calls to ILogger pattern in 10 files Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert Log.* calls to ILogger pattern in 6 files (94 calls total) Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert Log.* calls to ILogger pattern in TextControlAgentBase Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert TalkApplicationBCIScanner to ILogger pattern Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert FeatureExtraction.cs to ILogger pattern Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert Log calls to ILogger in TextController.cs - 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> * Fix spelling in parameter name and improve LogTrace message - Fixed typo: AutoCOmpleteCaretPos → AutoCompleteCaretPos - Enhanced LogTrace message to include punctuation parameter Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Fix double space in log message template Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert CameraActuator logging to ILogger * Convert PanelAnimationManager to use ILogger with structured logging Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert logging in OpenBCIDeviceTester.cs to Microsoft.Extensions.Logging - 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> * Convert Log.Debug to _logger.LogDebug in SensorForm.cs Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert all 26 Log calls to ILogger in DecisionMaker.cs Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Use NullLogger singleton for efficient default logger * Rename _defaultLogger to _nullLogger for clarity Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Convert 26 Log calls to ILogger in UserControlAnimationManager Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com> * Standardize logger creation with LoggingConfiguration 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. * Refactor logger usage and cleanup in handler/util classes 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. * Refactor logging and naming for consistency and robustness 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. * Refactor: Add DI & centralized logging for managers/extensions 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. * Refactor: Migrate logging from Log to ILogger for improved consistency --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Michael Beale <michael.beale@intel.com> Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
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.
No description provided.