@@ -9,6 +9,7 @@ package com.datadog.android
9
9
import android.content.Context
10
10
import androidx.annotation.AnyThread
11
11
import androidx.annotation.WorkerThread
12
+ import com.datadog.android.Datadog.clearAccountInfo
12
13
import com.datadog.android.api.InternalLogger
13
14
import com.datadog.android.api.SdkCore
14
15
import com.datadog.android.api.context.UserInfo
@@ -260,7 +261,10 @@ object Datadog {
260
261
}
261
262
262
263
/* *
263
- * Sets the user information.
264
+ * Sets the information used to identify a real user.
265
+ *
266
+ * This API should be used to assign a stable identifier for the user, such as a user ID,
267
+ * email, or username. The information set here will be added to logs, traces and RUM events.
264
268
*
265
269
* @param id (nullable) a unique user identifier (relevant to your business domain)
266
270
* @param name (nullable) the user name or alias
@@ -315,9 +319,14 @@ object Datadog {
315
319
}
316
320
317
321
/* *
318
- * Sets current account information.
322
+ * Sets the account information that the user is currently logged into.
323
+ *
324
+ * This API should be used to assign an identifier for the user's account which represents a
325
+ * contextual identity within the app, typically tied to business or tenant logic. The
326
+ * information set here will be added to logs, traces and RUM events.
319
327
*
320
- * Those will be added to logs, traces and RUM events automatically.
328
+ * This value should be set when user logs in with his account, and cleared by calling
329
+ * [clearAccountInfo] when he logs out.
321
330
*
322
331
* @param id Account ID.
323
332
* @param name representing the account, if exists.
@@ -340,7 +349,8 @@ object Datadog {
340
349
)
341
350
}
342
351
343
- /* * Add custom attributes to the current account information
352
+ /* *
353
+ * Add custom attributes to the current account information.
344
354
*
345
355
* This extra info will be added to already existing extra info that is added
346
356
* to Logs, Traces and RUM events automatically.
@@ -358,7 +368,8 @@ object Datadog {
358
368
sdkCore.addAccountExtraInfo(extraInfo)
359
369
}
360
370
361
- /* * Clear the current account information
371
+ /* *
372
+ * Clear the current account information.
362
373
*
363
374
* Account information will set to null
364
375
* Following Logs, Traces, RUM Events will not include the account information anymore.
0 commit comments