# デバッキング
SDKを実装する中で、IDEコントローラーでのログを確認すること、またはTEのDebug機能を利用してデバッキングすることが可能です。
# SDKログをプリント
TDAnalytics.enableLog(true);
# Debug機能
TEのDebug機能を利用して、デバッキングを行えます。
Debug機能は以下の2ステップで利用できます。
- DebugConsumerを使用
以下はDebugConsumerのコード例:
/*
DebugConsumer: Data is reported item by item. When a problem occurs, the user will be prompted with logs and exceptions; it is not recommended to use it in an online environment
The third parameter identifies whether to enter the warehouse, true indicates the warehouse, and false indicates not to enter the warehouse
*/
TDAnalytics te = new TDAnalytics(new DebugConsumer(SERVER_URI, APPID,true));
String deviceId = "te_device_id";
//set properties
Map<String,Object> properties = new HashMap<String,Object>();
properties.put("name", "shoes");
try {
te.track("account_id","distinct_id","payment",properties);
} catch (Exception e) {
System.out.println("except:"+e);
}
- TE后台添加Debug设备
- TEシステム内でDebugデバイスを追加
Debugモードを本番環境でリリースしてしまうことを避けるため、特定のデバイスのみDebugモードが起動できます。
クライアントでDebugモードを起動し、デバイスIDをTEシステムの「データ管理」→「デバッグモード」で追加した上でDebugモードに起動できます。
Debugモードはデータ収集の質とAppの安定性に影響しますため、データ検証のみお使いください。