Skip to content

Commit

Permalink
feat: Upgrade AppSyncRTClient 1.8.0 and enable logs (#519)
Browse files Browse the repository at this point in the history
* pod repo update

* feat: Upgrade AppSyncRTClient 1.8.0 and enable logs

* Set subscription log level
  • Loading branch information
lawmicha authored Feb 25, 2022
1 parent 48859be commit b3acd23
Show file tree
Hide file tree
Showing 31 changed files with 2,541 additions and 2,253 deletions.
3 changes: 3 additions & 0 deletions AWSAppSyncClient/AWSAppSyncClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import Foundation
import AWSCore
import AppSyncRealTimeClient

public typealias SubscriptionResultHandler<Operation: GraphQLSubscription> = (_ result: GraphQLResult<Operation.Data>?, _ transaction: ApolloStore.ReadWriteTransaction?, _ error: Error?) -> Void

Expand Down Expand Up @@ -119,6 +120,8 @@ public class AWSAppSyncClient {
name: .appSyncReachabilityChanged,
object: nil)

AppSyncRealTimeClient.logLevel = AppSyncLogHelper.subscriptionLogLevel

try AWSAppSyncClient.prefixTrackerQueue.sync {
if appSyncConfig.cacheConfiguration?.usePrefix ?? false {
let prefixTrackerKey = appSyncConfig.cacheConfiguration?.prefix ?? ""
Expand Down
19 changes: 18 additions & 1 deletion AWSAppSyncClient/Internal/AppSyncLogHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import Foundation
import AWSCore
import AppSyncRealTimeClient

struct AppSyncLogHelper {

Expand All @@ -19,7 +20,6 @@ struct AppSyncLogHelper {
file: String,
function: String,
line: UInt) {

AWSDDLog.log(asynchronous: true,
level: AWSDDLog.sharedInstance.logLevel,
flag: flag,
Expand All @@ -31,4 +31,21 @@ struct AppSyncLogHelper {
format: message,
arguments: getVaList([]))
}

static var subscriptionLogLevel: AppSyncRealTimeClient.LogLevel {
switch AWSDDLog.sharedInstance.logLevel {
case .off, .error:
return .error
case .warning:
return .warn
case .info:
return .info
case .debug:
return .debug
case .verbose, .all:
return .verbose
@unknown default:
return .error
}
}
}
5 changes: 2 additions & 3 deletions AWSAppSyncTestCommon/AppSyncClientTestHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,8 @@ public class AppSyncClientTestHelper: NSObject {
throw TestHelperError.setupError(AppSyncClientTestHelper.testSetupErrorMessage)
}

AWSDDLog.sharedInstance.logLevel = .error
AWSDDLog.add(AWSDDTTYLogger.sharedInstance)

AWSDDLog.sharedInstance.add(AWSDDTTYLogger.sharedInstance)

let appSyncConfig = try AppSyncClientTestHelper.makeAppSyncConfiguration(
for: authenticationType,
testConfiguration: resolvedTestConfiguration,
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "aws/aws-sdk-ios" ~> 2.27.0
github "stephencelis/SQLite.swift" ~> 0.12.2
github "aws-amplify/aws-appsync-realtime-client-ios" ~> 1.7
github "aws-amplify/aws-appsync-realtime-client-ios" ~> 1.8
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let package = Package(
.package(
name: "AppSyncRealTimeClient",
url: "https://github.com/aws-amplify/aws-appsync-realtime-client-ios.git",
from: "1.7.0"
from: "1.8.0"
),
.package(
url: "https://github.com/stephencelis/SQLite.swift.git",
Expand Down
4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AWS_SDK_VERSION = "2.27.0"
target "AWSAppSync" do
pod "AWSCore", "~> #{AWS_SDK_VERSION}"
pod "SQLite.swift", "~> 0.12.2"
pod "AppSyncRealTimeClient", "~> 1.7"
pod "AppSyncRealTimeClient", "~> 1.8"

pod "SwiftLint"
end
Expand All @@ -18,7 +18,7 @@ target "AWSAppSyncTestCommon" do
# We directly access a database connection to verify certain initialization
# setups
pod "SQLite.swift", "~> 0.12.2"
pod "AppSyncRealTimeClient", "~> 1.7"
pod "AppSyncRealTimeClient", "~> 1.8"
end

target "AWSAppSyncTestApp" do
Expand Down
54 changes: 27 additions & 27 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
PODS:
- AppSyncRealTimeClient (1.8.0):
- AppSyncRealTimeClient (1.9.0):
- Starscream (~> 4.0.4)
- AWSAuthCore (2.27.0):
- AWSCore (= 2.27.0)
- AWSCognitoIdentityProvider (2.27.0):
- AWSCognitoIdentityProviderASF (= 2.27.0)
- AWSCore (= 2.27.0)
- AWSCognitoIdentityProviderASF (2.27.0):
- AWSCore (= 2.27.0)
- AWSCore (2.27.0)
- AWSMobileClient (2.27.0):
- AWSAuthCore (= 2.27.0)
- AWSCognitoIdentityProvider (= 2.27.0)
- AWSCognitoIdentityProviderASF (= 2.27.0)
- AWSCore (= 2.27.0)
- AWSS3 (2.27.0):
- AWSCore (= 2.27.0)
- AWSAuthCore (2.27.1):
- AWSCore (= 2.27.1)
- AWSCognitoIdentityProvider (2.27.1):
- AWSCognitoIdentityProviderASF (= 2.27.1)
- AWSCore (= 2.27.1)
- AWSCognitoIdentityProviderASF (2.27.1):
- AWSCore (= 2.27.1)
- AWSCore (2.27.1)
- AWSMobileClient (2.27.1):
- AWSAuthCore (= 2.27.1)
- AWSCognitoIdentityProvider (= 2.27.1)
- AWSCognitoIdentityProviderASF (= 2.27.1)
- AWSCore (= 2.27.1)
- AWSS3 (2.27.1):
- AWSCore (= 2.27.1)
- SQLite.swift (0.12.2):
- SQLite.swift/standard (= 0.12.2)
- SQLite.swift/standard (0.12.2)
- Starscream (4.0.4)
- SwiftLint (0.46.1)
- SwiftLint (0.46.3)

DEPENDENCIES:
- AppSyncRealTimeClient (~> 1.7)
- AppSyncRealTimeClient (~> 1.8)
- AWSCore (~> 2.27.0)
- AWSMobileClient (~> 2.27.0)
- AWSS3 (~> 2.27.0)
Expand All @@ -44,17 +44,17 @@ SPEC REPOS:
- SwiftLint

SPEC CHECKSUMS:
AppSyncRealTimeClient: 463678f3a459c6e77851ca8e23dd7e0108bfb717
AWSAuthCore: e030e0d0c6102b5bf4e117601572ac3112b44ffe
AWSCognitoIdentityProvider: b62f4c11ccc03e4dec804f84820b94235271e103
AWSCognitoIdentityProviderASF: 0f0b7dfc43977225be9ae809bcc1ac46df217551
AWSCore: d605449939e5b40704f11ff9f91f905f7d978589
AWSMobileClient: a408fa2b5e04807de0a4dcd173153edb7ed05958
AWSS3: 6e349583add82363b27aaa2d9d582188c9110a17
AppSyncRealTimeClient: 147743ef36c99e25a47ecd3e8f7b6991ba7e3bdd
AWSAuthCore: 9528c60ccdac6df6024fb0af1ed6a43782fd2d3d
AWSCognitoIdentityProvider: 4de7f96340be72c1dca35c0ba835c6b9b69a28c0
AWSCognitoIdentityProviderASF: 727f7c1c80d667a2da79e408c8c8745eac981d58
AWSCore: f859f6955a8e52dcb3e79fac95fef058639d1049
AWSMobileClient: 9c1edcbe7088b3c9b910aaf6faf2db43a8f1568d
AWSS3: 3389c12e5b0cbfdfb6894c5921c094f58ec84df0
SQLite.swift: d2b4642190917051ce6bd1d49aab565fe794eea3
Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9
SwiftLint: aaa29a9f649316095a9079595cb60906bd899353
SwiftLint: ae76d82f056734f853c8cd0371503252c606c482

PODFILE CHECKSUM: d63046f54a6332ac228715a3273b748f6c352b16
PODFILE CHECKSUM: b82a1e6a826f74a8618dacc86495fe40efcff1ac

COCOAPODS: 1.11.2

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Pods/AWSCore/AWSCore/Service/AWSService.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 17 additions & 9 deletions Pods/AWSMobileClient/AWSCognitoAuth/AWSCognitoAuth.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Pods/AWSS3/AWSS3/AWSS3PreSignedURL.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Pods/AWSS3/AWSS3/AWSS3Service.m

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b3acd23

Please sign in to comment.