Skip to content

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

Merged
merged 11 commits into from
Aug 7, 2025
Merged

Add network logging support #63

merged 11 commits into from
Aug 7, 2025

Conversation

stevensJourney
Copy link
Contributor

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.

@stevensJourney stevensJourney requested a review from Copilot August 7, 2025 14:13
Copy link

@Copilot Copilot AI left a 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

@stevensJourney stevensJourney marked this pull request as ready for review August 7, 2025 14:35
Copy link
Contributor

@simolus3 simolus3 left a 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!

@stevensJourney stevensJourney merged commit 3c186a2 into main Aug 7, 2025
3 checks passed
@stevensJourney stevensJourney deleted the network-logging branch August 7, 2025 15:26
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