-
Notifications
You must be signed in to change notification settings - Fork 5
Add network logging support #63
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
Conversation
There was a problem hiding this comment.
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 adds network logging capabilities to the PowerSync Swift SDK, allowing developers to log HTTP requests made during synchronization. The implementation mirrors the functionality previously added to the PowerSync Kotlin SDK.
Key changes:
- Introduces new logging configuration types (
SyncRequestLogLevel
,SyncRequestLoggerConfiguration
,SyncClientConfiguration
) - Extends connection options to support client configuration with logging
- Adds Kotlin interoperability for network logging through extensions
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
Sources/PowerSync/Protocol/SyncRequestLogger.swift |
Defines logging configuration types and log levels for network requests |
Sources/PowerSync/Protocol/PowerSyncDatabaseProtocol.swift |
Adds SyncClientConfiguration and extends ConnectOptions to support logging |
Sources/PowerSync/Kotlin/KotlinNetworkLogger.swift |
Provides Kotlin interop extensions for logging configuration |
Sources/PowerSync/Kotlin/KotlinPowerSyncDatabaseImpl.swift |
Updates connection logic to pass logging configuration to Kotlin layer |
Tests/PowerSyncTests/ConnectTests.swift |
Adds test to verify HTTP request logging functionality |
Demo/PowerSyncExample/PowerSync/SystemManager.swift |
Demonstrates usage of new logging feature in demo app |
CHANGELOG.md |
Documents the new logging feature with usage example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Overview
This adds the ability to log PowerSync network requests. This is the Swift port of powersync-ja/powersync-kotlin#229.
This also removes the experimental
ConnectionMethod
options which have recently been removed from the Kotlin SDK.