-
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
Offering
: improved confusing log for PackageType.custom
#1884
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 |
---|---|---|
|
@@ -109,6 +109,7 @@ import Foundation | |
return package(identifier: key) | ||
} | ||
|
||
// swiftlint:disable:next cyclomatic_complexity | ||
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. Hmm might be good to try to refactor this to avoid this issue... But NABD. 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. Yeah I thought about it but this needs to be in |
||
init(identifier: String, serverDescription: String, availablePackages: [Package]) { | ||
self.identifier = identifier | ||
self.serverDescription = serverDescription | ||
|
@@ -138,11 +139,13 @@ import Foundation | |
case .custom where package.storeProduct.productCategory == .nonSubscription: | ||
// Non-subscription product, ignoring | ||
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 still left this extra |
||
continue | ||
case .unknown, .custom: | ||
Logger.warn( | ||
"Unknown subscription length for package '\(package.offeringIdentifier)': " + | ||
"\(package.packageType). Ignoring." | ||
) | ||
|
||
case .custom: | ||
Logger.debug(Strings.offering.custom_package_type(package)) | ||
continue | ||
|
||
case .unknown: | ||
Logger.warn(Strings.offering.unknown_package_type(package)) | ||
continue | ||
} | ||
|
||
|
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.
I see the cases above have a parameter name in addition to the type. Is that ok? And if so, it might be a good idea to consolidate them.
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.
It's useful for parameters like
String
s because it's not clear what they contain. But a package is always going to be a package 😅