Stay organized with collections
Save and categorize content based on your preferences.
AnalyticsLogger
class
AnalyticsLogger
<
LogProtoT
:
Any
>
Direct use of AnalyticsLogger
is not supported.
Logs DtdiClientLog
entries.
Summary
enum
Direct use of AnalyticsUserType
is not supported.
Direct use of DTDI_LOG_SOURCE
is not supported.
Log a message to this logger's underlying transport.
Creates an AnalyticsLogger by creating a serialized log protos.
Constants
DTDI_LOG_SOURCE
const
val
DTDI_LOG_SOURCE
:
String
Direct use of DTDI_LOG_SOURCE
is not supported.
The log source name for DTDI.
Value: "DTDI"
Public methods
log
fun
log
(
event
:
LogProtoT
,
correlationData
:
CorrelationData
,
clientInfo
:
ClientInfo
?
)
:
Unit
Log a message to this logger's underlying transport.
Companion functions
create
fun
<
T
:
Any
>
create
(
context
:
Context
,
logCreator
:
(
T
)
->
ByteArray
,
loggingConfigurationStrategy
:
LoggingConfigurationStrategy
,
loggerTransport
:
LoggerTransport
,
userType
:
AnalyticsLogger.AnalyticsUserType
)
:
AnalyticsLogger
<
T
>
Creates an AnalyticsLogger by creating a serialized log protos.
The context used for logging.
Function that creates a serialized byte array of DtdiClientLog
to be
merged into the log event.
Strategy for determining whether or not logging is
enabled, which may change depending on the log types.
Analytics logging transport.
The type of user associated with the logs.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eAnalyticsLogger\u003c/code\u003e logs \u003ccode\u003eDtdiClientLog\u003c/code\u003e entries and is not intended for direct use.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003elog\u003c/code\u003e function sends log messages to the designated transport, utilizing \u003ccode\u003eCorrelationData\u003c/code\u003e and optional \u003ccode\u003eClientInfo\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecreate\u003c/code\u003e function instantiates an \u003ccode\u003eAnalyticsLogger\u003c/code\u003e by serializing log protos with context, a log creator function, logging configuration strategy, transport, and user type.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDTDI_LOG_SOURCE\u003c/code\u003e, a constant string representing the log source for DTDI, is also not for direct use.\u003c/p\u003e\n"]]],["The `AnalyticsLogger` class logs `DtdiClientLog` entries, but direct use is unsupported. It offers a `log` function to send messages to its transport, accepting an event, correlation data, and optional client info. The `create` function, a companion method, generates an `AnalyticsLogger` instance. It requires context, a log creator function, a logging configuration strategy, a logger transport, and the user type. `DTDI_LOG_SOURCE` constant defines the log source name.\n"],null,["# AnalyticsLogger\n===============\n\n```\nclass AnalyticsLogger\u003cLogProtoT : Any\u003e\n```\n\n|---|------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [com.google.android.gms.dtdi.analytics.AnalyticsLogger](#) |\n\nDirect use of `AnalyticsLogger` is not supported.\n\nLogs `DtdiClientLog` entries.\n\nSummary\n-------\n\n| ### Nested classes ||\n|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| enum | [AnalyticsUserType](/android/reference/com/google/android/gms/dtdi/analytics/AnalyticsLogger.AnalyticsUserType) Direct use of `AnalyticsUserType` is not supported. |\n| abstract | [LogInjector](/android/reference/com/google/android/gms/dtdi/analytics/AnalyticsLogger.LogInjector) \u003cbr /\u003e |\n\n| ### Constants ||\n|----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|\n| const [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DTDI_LOG_SOURCE](#Companion.DTDI_LOG_SOURCE:kotlin.String) Direct use of `DTDI_LOG_SOURCE` is not supported. |\n\n| ### Public methods ||\n|------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [log](#log(com.google.android.gms.dtdi.analytics.AnalyticsLogger.LogProtoT,%20com.google.android.gms.dtdi.analytics.CorrelationData,%20com.google.android.gms.dtdi.analytics.ClientInfo))`(`event:` `LogProtoT`, `correlationData:` `[CorrelationData](/android/reference/com/google/android/gms/dtdi/analytics/CorrelationData)`, `clientInfo:` `[ClientInfo](/android/reference/com/google/android/gms/dtdi/analytics/ClientInfo)?`)` Log a message to this logger's underlying transport. |\n\n| ### Companion functions ||\n|---------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [AnalyticsLogger](#)\\\u003cT\\\u003e | [create](#Companion.create(android.content.Context,%20kotlin.Function1,%20com.google.android.gms.dtdi.analytics.LoggingConfigurationStrategy,%20com.google.android.gms.dtdi.analytics.LoggerTransport,%20com.google.android.gms.dtdi.analytics.AnalyticsLogger.AnalyticsUserType))`(`context:` `[Context](https://developer.android.com/reference/android/content/Context.html)`, `logCreator:` `(T)` `-\u003e` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)`, `loggingConfigurationStrategy:` `[LoggingConfigurationStrategy](/android/reference/com/google/android/gms/dtdi/analytics/LoggingConfigurationStrategy)`, `loggerTransport:` `[LoggerTransport](/android/reference/com/google/android/gms/dtdi/analytics/LoggerTransport)`, `userType:` `[AnalyticsLogger.AnalyticsUserType](/android/reference/com/google/android/gms/dtdi/analytics/AnalyticsLogger.AnalyticsUserType)`)` Creates an AnalyticsLogger by creating a serialized log protos. |\n\nConstants\n---------\n\n### DTDI_LOG_SOURCE\n\n```\nconst val DTDI_LOG_SOURCE: String\n```\n\nDirect use of `DTDI_LOG_SOURCE` is not supported.\n\nThe log source name for DTDI. \n\n Value: \"DTDI\"\n\nPublic methods\n--------------\n\n### log\n\n```\nfun log(\n event: LogProtoT, \n correlationData: CorrelationData, \n clientInfo: ClientInfo?\n): Unit\n```\n\nLog a message to this logger's underlying transport.\n\nCompanion functions\n-------------------\n\n### create\n\n```\nfun \u003cT : Any\u003e create(\n context: Context, \n logCreator: (T) -\u003e ByteArray, \n loggingConfigurationStrategy: LoggingConfigurationStrategy, \n loggerTransport: LoggerTransport, \n userType: AnalyticsLogger.AnalyticsUserType\n): AnalyticsLogger\u003cT\u003e\n```\n\nCreates an AnalyticsLogger by creating a serialized log protos.\n\n| Parameters ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| context: [Context](https://developer.android.com/reference/android/content/Context.html) | The context used for logging. |\n| logCreator: (T) -\\\u003e [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html) | Function that creates a serialized byte array of [DtdiClientLog](#) to be merged into the log event. |\n| loggingConfigurationStrategy: [LoggingConfigurationStrategy](/android/reference/com/google/android/gms/dtdi/analytics/LoggingConfigurationStrategy) | Strategy for determining whether or not logging is enabled, which may change depending on the log types. |\n| loggerTransport: [LoggerTransport](/android/reference/com/google/android/gms/dtdi/analytics/LoggerTransport) | Analytics logging transport. |\n| userType: [AnalyticsLogger.AnalyticsUserType](/android/reference/com/google/android/gms/dtdi/analytics/AnalyticsLogger.AnalyticsUserType) | The type of user associated with the logs. |"]]