Skip to content

Commit

Permalink
Move log device.architecture member under dd
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzybinary committed Nov 15, 2022
1 parent 106c418 commit 2de7fa4
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 18 deletions.
13 changes: 9 additions & 4 deletions dd-sdk-android/apiSurface
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class com.datadog.android.log.Logger
fun removeTag(String)
fun removeTagsWithKey(String)
data class com.datadog.android.log.model.LogEvent
constructor(Status, kotlin.String, kotlin.String, kotlin.String, Logger, Device, Usr? = null, Network? = null, Error? = null, kotlin.String, kotlin.collections.MutableMap<kotlin.String, kotlin.Any?> = mutableMapOf())
constructor(Status, kotlin.String, kotlin.String, kotlin.String, Logger, Dd, Usr? = null, Network? = null, Error? = null, kotlin.String, kotlin.collections.MutableMap<kotlin.String, kotlin.Any?> = mutableMapOf())
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): LogEvent
Expand All @@ -248,11 +248,11 @@ data class com.datadog.android.log.model.LogEvent
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Logger
data class Device
constructor(kotlin.String)
data class Dd
constructor(Device)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Device
fun fromJson(kotlin.String): Dd
data class Usr
constructor(kotlin.String? = null, kotlin.String? = null, kotlin.String? = null, kotlin.collections.MutableMap<kotlin.String, kotlin.Any?> = mutableMapOf())
fun toJson(): com.google.gson.JsonElement
Expand All @@ -268,6 +268,11 @@ data class com.datadog.android.log.model.LogEvent
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Error
data class Device
constructor(kotlin.String)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Device
data class Client
constructor(SimCarrier? = null, kotlin.String? = null, kotlin.String? = null, kotlin.String? = null, kotlin.String)
fun toJson(): com.google.gson.JsonElement
Expand Down
24 changes: 17 additions & 7 deletions dd-sdk-android/src/main/json/log/log-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,28 @@
],
"readOnly": true
},
"device": {
"_dd": {
"type": "object",
"description": "Information about the device that produced this log.",
"description": "Datadog internal information",
"properties": {
"architecture": {
"type": "string",
"description": "The CPU architecture of the device",
"device": {
"type": "object",
"description": "Information about the device that produced this log.",
"properties": {
"architecture": {
"type": "string",
"description": "The CPU architecture of the device",
"readOnly": true
}
},
"required": [
"architecture"
],
"readOnly": true
}
},
"required": [
"architecture"
"device"
],
"readOnly": true
},
Expand Down Expand Up @@ -182,7 +192,7 @@
"date",
"service",
"logger",
"device",
"_dd",
"ddtags"
],
"additionalProperties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ internal class LogGenerator(
date = formattedDate,
error = error,
logger = loggerInfo,
device = LogEvent.Device(
architecture = architecture
dd = LogEvent.Dd(
device = LogEvent.Device(
architecture = architecture
)
),
usr = usr,
network = network,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ internal class LogEventAssert(actual: LogEvent) :
}

fun hasDeviceArchitecture(expected: String): LogEventAssert {
assertThat(actual.device.architecture)
assertThat(actual.dd.device.architecture)
.overridingErrorMessage(
"Expected device to have architecture $expected but was ${actual.device.architecture}"
"Expected device to have architecture $expected but was ${actual.dd.device.architecture}"
)
.isEqualTo(expected)
return this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ internal class LogEventForgeryFactory : ForgeryFactory<LogEvent> {
version = forge.aStringMatching("[0-9]\\.[0-9]\\.[0-9]"),
threadName = forge.aNullable { forge.anAlphabeticalString() }
),
device = LogEvent.Device(
architecture = forge.anAlphaNumericalString()
dd = LogEvent.Dd(
device = LogEvent.Device(
architecture = forge.anAlphaNumericalString()
)
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ internal object RuntimeConfig {

val stringAttributes = mapOf(
"version_name" to BuildConfig.VERSION_NAME,
"device" to Build.DEVICE,
"build_device" to Build.DEVICE,
"null_string" to null
)

Expand Down

0 comments on commit 2de7fa4

Please sign in to comment.