-
Notifications
You must be signed in to change notification settings - Fork 316
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
Refactor: extracted all log strings #2600
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// Copyright RevenueCat Inc. All Rights Reserved. | ||
// | ||
// Licensed under the MIT License (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://opensource.org/licenses/MIT | ||
// | ||
// DiagnosticsStrings.swift | ||
// | ||
// Created by Nacho Soto on 6/8/23. | ||
|
||
import Foundation | ||
|
||
// swiftlint:disable identifier_name | ||
|
||
enum DiagnosticsStrings { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I started this, which will grow more with the upcoming diagnostics. |
||
|
||
case timing_message(message: String, duration: TimeInterval) | ||
|
||
} | ||
|
||
extension DiagnosticsStrings: CustomStringConvertible { | ||
|
||
var description: String { | ||
switch self { | ||
case let .timing_message(message, duration): | ||
let roundedDuration = (duration * 100).rounded(.down) / 100 | ||
return String(format: "%@ (%.2f seconds)", message.description, roundedDuration) | ||
} | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,10 @@ enum PurchaseStrings { | |
case sk2_transactions_update_received_transaction(StoreTransaction) | ||
case sk1_purchase_too_slow | ||
case sk2_purchase_too_slow | ||
case payment_queue_wrapper_delegate_call_sk1_enabled | ||
|
||
// swiftlint:disable:next identifier_name | ||
case restorepurchases_called_with_allow_sharing_appstore_account_false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick and it was like this before but should this be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it was like this because the method is |
||
|
||
} | ||
|
||
|
@@ -282,6 +286,13 @@ extension PurchaseStrings: CustomStringConvertible { | |
|
||
case .sk2_purchase_too_slow: | ||
return "StoreKit 2 purchase took longer than expected" | ||
|
||
case .payment_queue_wrapper_delegate_call_sk1_enabled: | ||
return "Unexpectedly received PaymentQueueWrapperDelegate call with SK1 enabled" | ||
|
||
case .restorepurchases_called_with_allow_sharing_appstore_account_false: | ||
return "allowSharingAppStoreAccount is set to false and restorePurchases has been called. " + | ||
"Are you sure you want to do this?" | ||
} | ||
} | ||
|
||
|
This file was deleted.
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.
This was unnecessarily being compiled for the
Unit Tests
target as well.