Skip to main content
Version: 1.0

PlanetKit initialization and log setting

You must initialize PlanetKit before using any functions of LINE Planet in your application. This page provides a code example for initializing PlanetKit and configuring log settings.

Initialization

Initialize PlanetKit using PlanetKitManager.instance.initializePlanetKit(). You must set the server URL when calling PlanetKitManager.instance.initializePlanetKit().

Note

You can find the server URL for each environment in Development environment.

Future<void> initializePlanetKit() async {
final serverUrl = "SERVER_URL";
final initParam = PlanetKitInitParam(
logSetting: PlanetKitLogSetting(
enabled: true,
logLevel: PlanetKitLogLevel.silent,
logSizeLimit: PlanetKitLogSizeLimit.small),
serverUrl: serverUrl);
final result =
await PlanetKitManager.instance.initializePlanetKit(initParam);
}

Log setting

If you need to debug, you must set the members of logSetting of PlanetKitInitParam to enable logging and set configurations during initialization.

Enable logging

To enable logging, set enabled to true. By default, the logging is disabled.

Note

Logs can be output to files only.

Set the log level

You can adjust the level of debug information output by setting the log level.

To set the log level, set logLevel to one of the values in PlanetKitLogLevel. Available log level settings are as follows:

  • silent: PlanetKit does not output any debug information. (default)
  • simple: PlanetKit outputs simple debug information.
  • detailed: PlanetKit outputs detailed debug information.
Note

To request debugging to the LINE Planet team, you must send a log file created with the detailed level.

Set the log size limit

To set the total size limit of log files, set logSizeLimit to one of the values in PlanetKitLogSizeLimit. Available log size limit settings are as follows:

  • small: The total size limit of log files is 16MB.
  • medium: The total size limit of log files is 64MB.
  • large: The total size limit of log files is 256MB. (default)
  • unlimited: The total size of log files is unlimited.

Location of log files

Depending on the native platform, log files can be found in the following location:

  • iOS

    • Under the PlanetKit directory inside the application Library directory

      // example

      /var/mobile/Containers/Data/Application/ABD77C83-FBD4-4A1B-8DBD-C968336785D1/Library/PlanetKit
  • Android

    • Under the planet directory inside the application files directory

      // example

      /sdcard/Android/data/com.app.test.demo/files/planet