Skip to content

Conversation

@StephenHidem
Copy link
Owner

Closes #45

Added detailed logging statements in `AntCollection.cs` to track operations in `StartScanning`, `Remove`, and `Dispose` methods. Updated log messages for clarity and consistency.

In `SendMessageChannel.cs`, improved logging in `SendExtAcknowledgedDataAsync` to indicate method entry and completion, while removing verbose logging in `GetAvailableChannelIndexAsync`.
- Added detailed logging for timeouts and errors to improve traceability.
- Updated logging messages to use named placeholders for clarity.
- Clarified documentation for custom calibration parameters to specify 6 bytes.
- Removed unnecessary logging scopes to streamline code.
- Introduced error logging for invalid thresholds and geocache issues.
- Improved logging of busy flags in channel management for better context.
- Updated `CrankTorqueFrequencySensorTests` to configure logger and use event IDs for logging unknown data pages.
- Changed language version in `AntPlus.csproj` from 8.0 to 9.0.
- Replaced direct logging of unknown data pages in `CommonDataPages.cs` and `CrankTorqueFrequencySensor.cs` with a new `UnknownDataPage` method for structured logging.
- Added new constant event IDs in `CrankTorqueFrequencySensor` for better logging clarity.
- Introduced `LoggerExtensions.cs` for centralized logging of unknown data pages.
- Updated multiple files (`CommonSpeedCadence.cs`, `FitnessEquipment.cs`, `HeartRate.cs`, `UnknownDevice.cs`) to use the new logging method for consistency.
This commit introduces new logging methods in the
`SmallEarthTech.AntPlus.Extensions.Logging` namespace,
including `LogMethodEntry`, `LogAntDeviceState`,
`LogAntCollectionChange`, and `LogSendAcknowledgedMessage`.

Key updates include:
- Refactoring logging in `AntCollection.cs` to use new methods for device additions and removals.
- Modifying `SendMessageChannel.cs` to improve clarity in acknowledged message logging.
- Updating `AntDevice.cs` to replace existing logging calls with structured methods.
- Standardizing logging of unknown data pages in various device profile classes.
- Adding an `ILogger` parameter to the `SubfieldDataPage` constructor for enhanced logging during data parsing.

These changes improve the maintainability and readability of the logging code, facilitating better tracking of data flow and issue identification.
Improved logging methods in `LoggerExtensions` for better clarity and consistency, including new methods for logging ANT responses, ignored data pages, and data pages. Adjusted logging levels in `AntCollection.cs` and updated the `Parse` method in `AntDevice.cs` to utilize new logging methods. Modified `HandleFEState` to accept byte arrays for comprehensive data handling. Enhanced logging in `CommonDataPages.cs` and `AntChannel.cs` for clearer channel response information. Overall, these changes enhance the usability and performance of the logging framework.
- Added Trace level logging for ANT responses in `MessageHandler`.
- Updated message format in `LogAntCollectionChange` method.
- Modified `LogAntResponse` to use `ResponseId` directly.
- Changed event ID for `LogDataPage` from 1009 to 1010.
- Simplified Serilog configuration in `MauiProgram.cs`.
- Enhanced Serilog setup in `MainWindowViewModel.cs` to read from configuration.
- Updated `launchSettings.json` for improved logging command line arguments.
- Added `Serilog.Settings.Configuration` package reference in project file.
Enhanced logging for unhandled ANT responses with a new method, `LogUnhandledAntResponse`, in `AntCollection.cs` and `AntDeviceCollection.cs`. Updated `Hosting.csproj` to version 1.2.0.0 with revised release notes. Added new logging methods and documentation in `LoggerExtensions.cs`. Updated version history files for AntPlus and HostingExtensions, and created new XML documentation files for versions 5.1.0.0 and 1.2.0.0. Modified `ContentLayout.content` for visibility of new entries and updated `Documentation.shfbproj` to include the latest version history files.
@StephenHidem StephenHidem added the enhancement New feature or request label Mar 3, 2025
@StephenHidem StephenHidem added this to the Next Release milestone Mar 3, 2025
@StephenHidem StephenHidem linked an issue Mar 3, 2025 that may be closed by this pull request
4 tasks
@StephenHidem StephenHidem merged commit 823af36 into master Mar 3, 2025
1 check passed
@StephenHidem StephenHidem deleted the 45-improve-logging branch March 4, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Logging

2 participants