目录
此内容是否有帮助?

# Debugging and Logging

During the process of SDK Integration, you can perform real-time debugging by checking SDK logs in the IDE console or using the Debug function of TE.

# Debugging

You need to follow the following two steps to enable the Debug mode:

# 2.1 Use DebugConsumer

The sample code for enabling the Debug mode on the client side is as follows:

%% pre-init SDK
ta_consumer_debug:init(),

%% server_url
ta_consumer_debug:config_server_url("server_url"),
%% app_id
ta_consumer_debug:config_app_id("app_id"),
%% device_id
ta_consumer_debug:config_device_id("device_id"),
%% is need upload to TE?
ta_consumer_debug:config_is_write(true),

%% init SDK with debug consumer
thinking_analytics_sdk:init(thinking_analytics_sdk:consumer_type_debug()),

%% track event
thinking_analytics_sdk:track("account_id_Erlang", "distinct_id", "ViewProduct", #{"key_1" => "value_1", "key_2" => "value_2"}),

# 2.2 Add Device

To avoid launching the Debug mode in the production environment, it is required that only specified device can enable Debug mode. The Debug mode can only be enabled for devices whose ID has been configured in the "Debug data" sector on the "tracking management" page of the TE.

It can only be used for data verification at the integration stage, and should not be used in the online environment.