menu
Is this helpful?

# 디버깅

TE의 디버그 기능을 사용하여 디버깅을 수행할 수 있습니다. 디버그 기능은 다음 두 단계로 사용할 수 있습니다.

# 1. DebugConsumer 사용

다음은 DebugConsumer의 코드 예제입니다:

%% Reporting address configuration
ServerUrl = "server_url",
%% app_id configuration
AppID = "app_id",
%% Is the configuration written to the database?
IsWrite = true,
%% Configure device_id to view the reported data in real time on the TE backend.
DeviceId = "123456789",

%% init consumer
Consumer = td_debug_consumer:init_with_config(ServerUrl, AppID, IsWrite, DeviceId),
%% init SDK with consumer
TE_SDK = td_analytics:init_with_consumer(Consumer),

AccountId0 = "account_id_Erlang_0",

%% ordinary event
td_analytics:track_instance(TE_SDK, AccountId0, "distinct_logbus", "ViewProduct", #{"#key_1" => "🚓🦽🦼🚲🚜🚜🦽", "key_2" => 2.2, "key_array" => ["🚌", "🏍", "😚😊"]}),

%% When closing the SDK, it needs to be called. If you need to reopen the SDK after closing it, you must re-execute the initialization code mentioned above.
td_analytics:close_instance(TE_SDK).

# 2. TE 시스템 내에서 디버그 디바이스 추가

운영 환경에서 실수로 디버그 모드를 릴리스하는 것을 피하기 위해 특정 디바이스에서만 디버그 모드를 활성화할 수 있습니다.

클라이언트에서 디버그 모드를 활성화하고, 디바이스 ID를 TE 시스템의 [데이터 관리 → 디버그 모드]에서 추가한 후에 디버그 모드를 활성화할 수 있습니다.

디버그 모드는 데이터 수집의 질과 앱의 안정성에 영향을 미치므로 데이터 검증용으로만 사용하시기 바랍니다.