The LogApi library is used to output log messages from the application program.

The following is an overview of the LogApi library.

Output log messages

You can output a log message by calling the LOG_PRINTF function or LOG_PRINTF_T function from your application. The output log message is saved in the log buffer on the RAM managed by the OS.

Note:

  • The capacity of the log buffer is about 1MB. If a log message that exceeds the capacity is output before the log message is read by the method described below, the oldest log message is deleted in order.
  • The log message output by this library cannot be used for purposes where you want to keep a log even if the RAM data disappears due to battery removal or battery exhaustion. For such applications, write your own code to save the log to the Flash Disk in your application program.

Retrieving log messages

You can retrieve log messages from the log buffer by doing one of the following:

Save to file

  1. Enable Keep log on restart in the Log settings.
  2. Enable ZONE_APP in the Debug zone of the Log settings
  3. Run the user application that outputs the log message.
  4. If you execute "Save Log" from the System Menu: Other menu, the log message in the log buffer will be saved to FlashDisk with the file name "SAVELOG.TXT" after rebooting.
  5. Copy the log file to your PC using USB file transfer.

Receive with LogReceiver

  1. Enable Enable transfer in the Log settings and select USB or Bluetooth.
  2. Enable ZONE_APP in the Debug zone of the Log settings
  3. Launch LogReceiver on your PC and select the USB or Bluetooth checkbox
  4. Connect your PC and the device using the method of your choice.
  5. Run the user application that outputs the log message.
  6. The received log message is displayed in real time on the Log Receiver screen.

See also



Last updated: 2020/10/27