Skip to content

Commit

Permalink
♻️ Update log message format strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaatttt committed Oct 26, 2023
1 parent cdeae5d commit 321489b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Sources/AppcuesKit/Appcues.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public class Appcues: NSObject {

initializeContainer()

config.logger.info("Appcues SDK %{public}s initialized", version())
config.logger.info("Appcues SDK %{public}@ initialized", version())
}

/// Get the current version of the Appcues SDK.
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppcuesKit/Data/Analytics/AnalyticsTracker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ internal class AnalyticsTracker: AnalyticsTracking, AnalyticsSubscribing {
SdkMetrics.remove(activity.requestID)
}
case .failure(let error):
self?.config.logger.error("Failed processing qualify response: %{public}s", "\(error)")
self?.config.logger.error("Failed processing qualify response: %{public}@", "\(error)")
SdkMetrics.remove(activity.requestID)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppcuesKit/Data/Networking/DynamicCodingKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ extension KeyedEncodingContainer where K == DynamicCodingKeys {
if !encodingErrorKeys.isEmpty {
logger.error(
"""
Unsupported value(s) included in %{public}s when encoding key(s): %{public}s.
Unsupported value(s) included in %{public}@ when encoding key(s): %{public}@.
These keys have been omitted. Only String, Number, Date, URL and Bool types allowed.
""",
self.codingPath.pretty,
Expand Down
8 changes: 4 additions & 4 deletions Sources/AppcuesKit/Data/Networking/NetworkClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ internal class NetworkClient: Networking {
if let url = response?.url?.absoluteString, let statusCode = (response as? HTTPURLResponse)?.statusCode {
let data = String(data: data ?? Data(), encoding: .utf8) ?? ""

self?.config.logger.debug("RESPONSE: %{public}d %{public}s\n%{private}s", statusCode, url, data)
self?.config.logger.debug("RESPONSE: %{public}d %{public}@\n%{private}@", statusCode, url, data)
}

if let error = error {
Expand All @@ -161,7 +161,7 @@ internal class NetworkClient: Networking {

if let method = urlRequest.httpMethod, let url = urlRequest.url?.absoluteString {
let data = String(data: urlRequest.httpBody ?? Data(), encoding: .utf8) ?? ""
config.logger.debug("REQUEST: %{public}s %{public}s\n%{private}s", method, url, data)
config.logger.debug("REQUEST: %{public}@ %{public}@\n%{private}@", method, url, data)
}

dataTask.resume()
Expand All @@ -174,7 +174,7 @@ internal class NetworkClient: Networking {
) {
let dataTask = config.urlSession.dataTask(with: urlRequest) { [weak self] _, response, error in
if let url = response?.url?.absoluteString, let statusCode = (response as? HTTPURLResponse)?.statusCode {
self?.config.logger.debug("RESPONSE: %{public}d %{public}s", statusCode, url)
self?.config.logger.debug("RESPONSE: %{public}d %{public}@", statusCode, url)
}

if let error = error {
Expand All @@ -192,7 +192,7 @@ internal class NetworkClient: Networking {

if let method = urlRequest.httpMethod, let url = urlRequest.url?.absoluteString {
let data = String(data: urlRequest.httpBody ?? Data(), encoding: .utf8) ?? ""
config.logger.debug("REQUEST: %{public}s %{public}s\n%{private}s", method, url, data)
config.logger.debug("REQUEST: %{public}@ %{public}@\n%{private}@", method, url, data)
}

dataTask.resume()
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppcuesKit/Presentation/ExperienceLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ internal class ExperienceLoader: ExperienceLoading {
completion: completion
)
case .failure(let error):
self?.config.logger.error("Loading experience %{public}s failed with error %{public}s", experienceID, "\(error)")
self?.config.logger.error("Loading experience %{public}@ failed with error %{public}@", experienceID, "\(error)")
completion?(.failure(error))
}

Expand Down

0 comments on commit 321489b

Please sign in to comment.