Skip to content

Commit

Permalink
RUMM-494 Hotfix for crash on iOS 11.0 - 11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ncreated committed Jun 9, 2020
1 parent b543a3d commit 464c8f7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DatadogSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "DatadogSDK"
s.module_name = "Datadog"
s.version = "1.2.0"
s.version = "1.2.1"
s.summary = "Official Datadog Swift SDK for iOS."

s.homepage = "https://www.datadoghq.com"
Expand Down
2 changes: 1 addition & 1 deletion DatadogSDKObjc.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "DatadogSDKObjc"
s.module_name = "DatadogObjc"
s.version = "1.2.0"
s.version = "1.2.1"
s.summary = "Official Datadog Objective-C SDK for iOS."

s.homepage = "https://www.datadoghq.com"
Expand Down
4 changes: 3 additions & 1 deletion Sources/Datadog/Core/Utils/ISO8601DateFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import Foundation
extension ISO8601DateFormatter {
static func `default`() -> ISO8601DateFormatter {
let formatter = ISO8601DateFormatter()
formatter.formatOptions.insert(.withFractionalSeconds)
if #available(iOS 11.2, *) {
formatter.formatOptions.insert(.withFractionalSeconds)
}
return formatter
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Datadog/Datadog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Foundation

/// SDK version associated with logs.
/// Should be synced with SDK releases.
internal let sdkVersion = "1.2.0"
internal let sdkVersion = "1.2.1"

/// Datadog SDK configuration object.
public class Datadog {
Expand Down
6 changes: 5 additions & 1 deletion Sources/Datadog/Logs/LogOutputs/LogConsoleOutput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ internal struct LogConsoleOutput: LogOutput {
/// Time formatter used for `.short` output format.
static func shortTimeFormatter(calendar: Calendar = .current, timeZone: TimeZone = .current) -> Formatter {
let formatter = ISO8601DateFormatter.default()
formatter.formatOptions = [.withFractionalSeconds, .withFullTime]
if #available(iOS 11.2, *) {
formatter.formatOptions = [.withFractionalSeconds, .withFullTime]
} else {
formatter.formatOptions = [.withFullTime]
}
return formatter
}

Expand Down
4 changes: 3 additions & 1 deletion Tests/DatadogTests/Matchers/LogMatcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import XCTest
struct LogMatcher {
private static let dateFormatter: ISO8601DateFormatter = {
let formatter = ISO8601DateFormatter()
formatter.formatOptions.insert(.withFractionalSeconds)
if #available(iOS 11.2, *) {
formatter.formatOptions.insert(.withFractionalSeconds)
}
return formatter
}()

Expand Down

0 comments on commit 464c8f7

Please sign in to comment.