Real-time debugging
The SDK Debug mode is only for debugging during integration. Never use it in the production environment.
During SDK integration, you can debug in real time by viewing the SDK logs in the IDE console or by using the Debug feature of AE.
1. Print SDK logs
TDAnalytics.enableLog(isPrint=True)
2. Real-time debugging
During SDK integration, you can use the AE Debug feature for real-time debugging. To use the Debug feature, complete the following two steps:
- Use TDDebugConsumer
The following sample code uses TDDebugConsumer:
te = TDAnalytics(TDDebugConsumer("https://receiver-ta-demo.thinkingdata.cn", "appId", device_id="123456789"))
distinct_id = "ABD"
account_id = "11111"
try:
te.track(account_id=account_id, event_name='event_name', properties={'level': 0})
except Exception as e:
print(e)
- Add a Debug device in the AE backend
To prevent Debug mode from going live in the production environment, only specified devices can enable Debug mode. A device can enable Debug mode only if Debug mode is enabled on the client and the device ID has been added on the Data > Tracking > Debugger page in AE. To add a device, click Add test device in the upper-right corner of the page, click New device in the Select device drawer, and enter the device ID.
Debug mode may affect data collection quality and App stability. Use it only to verify data during integration, and don't use it in the production environment.

