Skip to content

Commit bb4fbee

Browse files
Merge pull request #2854 from DataDog/nogorodnikov/rum-15734/log-event-objc-missing-device-properties
Add device properties `isLowRam`, `logicalCpuCount`, `totalRam` to the `LogEvent` Objective-C API Co-authored-by: 0xnm <nikita.ogorodnikov@datadoghq.com>
2 parents feedabd + d8b709c commit bb4fbee

4 files changed

Lines changed: 20 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Unreleased
22

33
- [FIX] Propagate native `anonymous_id` to WebView RUM and Log events. See [#2847][]
4+
- [IMPROVEMENT] Add device properties `isLowRam`, `logicalCpuCount`, `totalRam` to the `LogEvent` Objective-C API. See [#2854][]
45

56
# 3.10.0 / 16-04-2026
67

@@ -1127,6 +1128,7 @@ Release `2.0` introduces breaking changes. Follow the [Migration Guide](MIGRATIO
11271128
[#2827]: https://github.com/DataDog/dd-sdk-ios/pull/2827
11281129
[#2829]: https://github.com/DataDog/dd-sdk-ios/pull/2829
11291130
[#2847]: https://github.com/DataDog/dd-sdk-ios/pull/2847
1131+
[#2854]: https://github.com/DataDog/dd-sdk-ios/pull/2854
11301132

11311133
[@00fa9a]: https://github.com/00FA9A
11321134
[@britton-earnin]: https://github.com/Britton-Earnin

DatadogLogs/Sources/LogsDataModels+objc.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,10 @@ public class objc_LogEventDevice: NSObject {
395395
root.swiftModel.device.brightnessLevel
396396
}
397397

398+
public var isLowRam: Bool? {
399+
root.swiftModel.device.isLowRam
400+
}
401+
398402
public var locale: String? {
399403
root.swiftModel.device.locale
400404
}
@@ -403,6 +407,10 @@ public class objc_LogEventDevice: NSObject {
403407
root.swiftModel.device.locales
404408
}
405409

410+
public var logicalCpuCount: Double? {
411+
root.swiftModel.device.logicalCpuCount
412+
}
413+
406414
public var model: String? {
407415
root.swiftModel.device.model
408416
}
@@ -419,6 +427,10 @@ public class objc_LogEventDevice: NSObject {
419427
root.swiftModel.device.timeZone
420428
}
421429

430+
public var totalRam: Double? {
431+
root.swiftModel.device.totalRam
432+
}
433+
422434
public var type: objc_LogEventDeviceDeviceType {
423435
.init(swift: root.swiftModel.device.type)
424436
}

DatadogLogs/Tests/LogsDataModels+objcTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ class LogsDataModels_objcTests: XCTestCase {
3333
XCTAssertEqual(swiftDevice.batteryLevel, objcDevice.batteryLevel)
3434
XCTAssertEqual(swiftDevice.brand, objcDevice.brand)
3535
XCTAssertEqual(swiftDevice.brightnessLevel, objcDevice.brightnessLevel)
36+
XCTAssertEqual(swiftDevice.isLowRam, objcDevice.isLowRam)
3637
XCTAssertEqual(swiftDevice.locale, objcDevice.locale)
3738
XCTAssertEqual(swiftDevice.locales, objcDevice.locales)
39+
XCTAssertEqual(swiftDevice.logicalCpuCount, objcDevice.logicalCpuCount)
3840
XCTAssertEqual(swiftDevice.model, objcDevice.model)
3941
XCTAssertEqual(swiftDevice.name, objcDevice.name)
4042
XCTAssertEqual(swiftDevice.powerSavingMode, objcDevice.powerSavingMode)
4143
XCTAssertEqual(swiftDevice.timeZone, objcDevice.timeZone)
44+
XCTAssertEqual(swiftDevice.totalRam, objcDevice.totalRam)
4245
XCTAssertEqual(swiftDevice.type, objcDevice.type.toSwift)
4346
}
4447
}

api-surface-objc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,15 @@ public class objc_LogEventDevice: NSObject
204204
public var batteryLevel: Double?
205205
public var brand: String?
206206
public var brightnessLevel: Double?
207+
public var isLowRam: Bool?
207208
public var locale: String?
208209
public var locales: [String]?
210+
public var logicalCpuCount: Double?
209211
public var model: String?
210212
public var name: String?
211213
public var powerSavingMode: Bool?
212214
public var timeZone: String?
215+
public var totalRam: Double?
213216
public var type: objc_LogEventDeviceDeviceType
214217
public enum objc_LogEventDeviceDeviceType: Int
215218
case none

0 commit comments

Comments
 (0)