Offline Log

Last Updated on : 2024-04-03 06:42:45download

IPC SDK provides the ThingSmartLogger component that implements the output of SDK running logs. This helps you troubleshoot problems that arise during the integration with the IPC SDK. This topic describes how to integrate this component into your project.

  1. Add the following code block to the Podfile:

    pod 'ThingSmartLogger'
    
  2. Add the following code block to the file AppDelegate.m:

    #import <ThingSmartLogger/ThingLogSDK.h>
    
    @interface AppDelegate ()
    @end
    
    @implementation AppDelegate
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        // your other code
        [ThingLogSDK startLog];
        // print log path
        NSLog(@"%@", [ThingLogSDK logPath]);
        return YES;
    }
    @end
    

    Once the ThingSmartLogger component is integrated, you must call the method [ThingLogSDK startLog]. Otherwise, only part of the logs will be printed in the console.

  3. (Recommended) Implement the output of offline logs for your app. You can share the logs as system files to facilitate troubleshooting.

    To ensure app information security, the offline log files are encrypted and cannot be viewed without decryption. To view the offline logs, export the log files and submit a ticket to request support.