Skip to main content

Logging

Using logging to locate errors

Description​

Logging - a tool needed when debugging iRidi projects. Obtaining a log is especially important if your project uses JavaScript.

ServerConsoleLog.png

The overall system consists of three parts:

  • Subsystem (highlighted in red);
  • Drivers (highlighted in yellow);
  • System (highlighted in green).

Subsystem - the general logging control levels.

The available levels are:

  • Level 0 - EMERGENCY (emergency);
  • Level 1 - ALERT (alert level);
  • Level 2 - CRITICAL (critical errors that prevent the application from continuing);
  • Level 3 - ERROR (errors that do not prevent the application from running);
  • Level 4 - WARNING (warnings that do not prevent the application from continuing);
  • Level 5 - NOTICE (notices);
  • Level 6 - INFO (information about current operations);
  • Level 7 - DEBUG (detailed information about current operations).

When you select a log level, the command line (on the server) displays all levels up to and including the selected level. For example, if you select "Error", the following are displayed: "Emergency", "Alert", "Critical", "Error".

Driver system

Includes all drivers in the server system.

System

Includes system-level logging, specifically everything running in the server core. It allows you to control the following systems:

  • Core (server core),
  • Database (database core),
  • Script (script core),
  • WebServer (web server core).

Microsoft Windows​

i3 pro for Windows (unlike iOS, Android, and Mac) allows you to view the system log directly in the application (local logging) and also supports sending the log to a remote PC (remote logging).

**Local logging **

You can open the i3 pro client application log for Windows by pressing F4 in the application window (or in the Emulator).

To ensure that the log displays the required data:

  1. Set the logging level for iRidi systems and subsystems in iRidi Studio. This is configured on the Debug tab in the Panel Project settings window. Logging levels range from EMERGENCY (errors only) to DEBUG (detailed information);
  2. Specify the logging depth for each driver added to the project;
  3. If your project contains JavaScript, use the method IR.Log("text") to output messages.

Log1.png Log2.png

  1. Run i3 pro or the Emulator on Windows and press F4 to open the log.

Log_window.png

Remote logging

The i3 pro log can be sent to a remote PC using system log collection software, generally called a Syslog Server. An example is www.winsyslog.com

Install and configure the server:

  1. specify the service's UDP port: 514, the same as in the i3 pro system settings
  2. start the Syslog Server

Configure i3 pro to connect to the Syslog Server:

  1. On the Debug tab in the Panel Project settings window, enable Activate and set IP address to the IP address of the PC running Syslog Server. The logging port is 514. Set the logging level for iRidi systems and subsystems in iRidi Studio. Logging levels range from EMERGENCY (errors only) to DEBUG (detailed information).
  2. Set the logging level for each driver added to the project.

Log1.png Log2.png

  1. Remote logging for i3 pro can be configured not only in the project on a PC, but also through the i3 pro system menu. Open the menu using the Show System Menu command after right-clicking the panel in iRidi Transfer, by pressing and holding an unused area of the project, or by swiping from the left edge of the screen. On the Remote debug tab, activate remote logging with Enable and set Syslog host to the IP address of the PC running Syslog Server, the port (514), and the logging level.

Log3-4.png

Apple iOS, Mac OS X, Google Android​

Unlike Windows, i3 pro for iOS, Android, and Mac does not display the system log directly in the application, so remote logging is used:

Remote logging

The i3 pro log can be sent to a remote PC using system log collection software, generally called a Syslog Server. An example is www.winsyslog.com

Install and configure the server:

  1. specify the service's UDP port: 514, the same as in the i3 pro system settings
  2. start the Syslog Server

Configure i3 pro to connect to the Syslog Server:

  1. On the Debug tab in the Panel Project settings window, enable Activate and set IP address to the IP address of the PC running Syslog Server. The logging port is 514. Set the logging level for iRidi systems and subsystems in iRidi Studio. Logging levels range from EMERGENCY (errors only) to DEBUG (detailed information).
  2. Set the logging level for each driver added to the project.

Log1.png Log2.png

  1. Remote logging for i3 pro can be configured not only in the project on a PC, but also through the i3 pro system menu. Open the menu using the Show System Menu command after right-clicking the panel in iRidi Transfer, by pressing and holding an unused area of the project, or by swiping from the left edge of the screen. On the Remote debug tab, activate remote logging with Enable and set Syslog host to the IP address of the PC running Syslog Server, the port (514), and the logging level.

Log3-4.png

Debugging the Android application​

USB debugging

Saves the i3 pro application log on Android to a text file. The saved log can be used to identify errors in the application.

See Android USB Debugging

Obtaining application operation information​

  • In a Panel Project on a PC:

Press F3 to view information about the application's memory usage.

  • In a project on a mobile device:

Open the system menu, then "Screen" and "Show FPS":

FPS_en.png

When enabled, application information appears:

F3.png

  • FPS - frames per second;
  • SPRITES - memory allocated to sprites, in KB (they have a separate garbage collector);
    • count - number of sprites (limited; the limit can be increased in the system menu);
    • free - number of free sprites.
  • MEMORY - total RAM on the device (always displayed as 0 on Android);
  • SCRIPT:

The first number is the total memory managed by the garbage collector, in KB (100-150 MB is normal). If the project is empty, memory used by system scripts (such as the menu) is displayed;

The second number is the current memory usage, i.e. the amount used by the garbage collector, in KB (garbage collection starts at 8 Mb);