SDK Log

Last Updated on : 2023-03-09 08:17:43

IPC SDK provides the API method that implements the output of custom logs. This helps you troubleshoot problems that might arise during the integration with the IPC SDK.

API description

By default, the system logs are printed in this method. During development and testing, you can get logs by using the console or the command adb logcat. However, after the app is launched, the retrieval of adb logs is difficult.

Therefore, Tuya provides this API method to output custom logs. You can set an interceptor to store and upload logs on top of your own log system.

public static void setLogInterception(int level, ILogInterception iLogInterception);

Parameters

Parameter Description
level The minimum level of the logs to be intercepted.
iLogInterception The log interceptor.

Log level Value
VERBOSE 2
DEBUG 3
INFO 4
WARN 5
ERROR 6

Example

L.setLogInterception(2, new ILogInterception() {
    @Override
    public void log(int i, String tag, String msg) {
        // Use your own log system to store and upload logs.
    }
});