Skip to content

Commit

Permalink
Merge pull request #1813 from DataDog/xgouchet/RUM-2441/verbose_synth…
Browse files Browse the repository at this point in the history
…etics_logs

RUM-2441 make synthetics logs more verbose
  • Loading branch information
xgouchet authored Jan 10, 2024
2 parents 5264083 + 48344ed commit 0f3e356
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package com.datadog.android.rum.internal.domain.scope

import android.app.ActivityManager
import android.util.Log
import androidx.annotation.WorkerThread
import com.datadog.android.api.InternalLogger
import com.datadog.android.api.feature.Feature
Expand Down Expand Up @@ -78,7 +77,6 @@ internal class RumApplicationScope(
syntheticsTestId = event.testId,
syntheticsResultId = event.resultId
)
Log.i(RumScope.SYNTHETICS_LOGCAT_TAG, "_dd.application.id=${rumContext.applicationId}")
}

val isInteraction = (event is RumRawEvent.StartView) || (event is RumRawEvent.StartAction)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

package com.datadog.android.rum.internal.domain.scope

import android.util.Log
import androidx.annotation.WorkerThread
import com.datadog.android.api.feature.Feature
import com.datadog.android.api.storage.DataWriter
Expand Down Expand Up @@ -201,9 +200,6 @@ internal class RumSessionScope(
sessionId = UUID.randomUUID().toString()
sessionStartNs.set(nanoTime)
sessionListener?.onSessionStarted(sessionId, !keepSession)
if (getRumContext().syntheticsTestId != null) {
Log.i(RumScope.SYNTHETICS_LOGCAT_TAG, "_dd.session.id=$sessionId")
}
}

private fun updateSessionStateForSessionReplay(state: State, sessionId: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ internal open class RumViewScope(
set(value) {
oldViewIds += field
field = value
if (getRumContext().syntheticsTestId != null) {
val rumContext = getRumContext()
if (rumContext.syntheticsTestId != null) {
Log.i(RumScope.SYNTHETICS_LOGCAT_TAG, "_dd.application.id=${rumContext.applicationId}")
Log.i(RumScope.SYNTHETICS_LOGCAT_TAG, "_dd.session.id=${rumContext.sessionId}")
Log.i(RumScope.SYNTHETICS_LOGCAT_TAG, "_dd.view.id=$viewId")
}
}

private val oldViewIds = mutableSetOf<String>()
private val startedNanos: Long = eventTime.nanoTime

Expand Down Expand Up @@ -147,7 +151,10 @@ internal open class RumViewScope(
cpuVitalMonitor.register(cpuVitalListener)
memoryVitalMonitor.register(memoryVitalListener)
frameRateVitalMonitor.register(frameRateVitalListener)
if (parentScope.getRumContext().syntheticsTestId != null) {
val rumContext = parentScope.getRumContext()
if (rumContext.syntheticsTestId != null) {
Log.i(RumScope.SYNTHETICS_LOGCAT_TAG, "_dd.application.id=${rumContext.applicationId}")
Log.i(RumScope.SYNTHETICS_LOGCAT_TAG, "_dd.session.id=${rumContext.sessionId}")
Log.i(RumScope.SYNTHETICS_LOGCAT_TAG, "_dd.view.id=$viewId")
}
}
Expand Down

0 comments on commit 0f3e356

Please sign in to comment.