Эта страница является
переводом страницы
Debugging. Перевод выполнен на 100%.
Logging
use of logging for error localization
Description
Logging is a tool required to debug iRidium projects. Getting logs is especially important if JavaScript is used in a project.
The general system consists of three parts:
- Subsystem (marked with red);
- Drivers (marked with yellow);
- System (marked with green).
Subsystem is general levels of log control .
There are the following levels:
- 0 level - EMERGENCY;
- 1 level - ALERT;
- 2 level - CRITICAL (critical errors that prevent further work of the app);
- 3 level - ERROR (errors that allow the app to work);
- 4 level - WARNING (warnings that prevent further work of the app);
- 5 level - NOTICE (notifications);
- 6 level - INFO (display of information about hapenning events);
- 7 level - DEBUG (display of detailed information about hapenning events).
There is a special feature in choosing a log level. If you choose a definite level, all levels up to the selected one are displayed in the sever command line. For example, if you choose the "Error" level, "Emergency", "Alert", "Critical", "Error" levels will be displayed.
Driver system
includes all drivers in the server system.
System
includes the system log level, to be more exact, it displayes everything that works in the server core. It allows to control such systems as:
- Core (the server core),
- Database (the core of the database),
- Script (the script core),
- WebServer (the core of the webserver).
Microsoft Windows
i3 pro for Windows (unlike for iOS, Android and Mac) allows you to see the system log directly in the application (Local logging). You can also send the log file to a remote PC (Remote logging)
Local logging
You can open the log of the i3 pro client application for Windows by clicking F4 in the application window (or in Emulator).
To enable display of required data in the log:
- 1. Indicate the logging depth for iRidium systems and subsystems in iRidium Studio. The setting up is performed in the Debug tab in the panel project settings window. The logging depth: from EMERGENCY (errors only) to DEBUG (full information)
- 2. Indicate the logging depth for each driver added in the project
- 3. If you use JavaScript in your project, use the
IR.Log("text") method to output messages
- 3. Start the i3 pro application or Emulator on Windows, then click F4 to open the log.
Remote logging
The log of i3 pro can be sent to a remote PC. The log is sent with the help of software generally called Syslog Server. Here is an example of such a program: www.winsyslog.com
[Install] and set up the server:
- 1. enter the UDP-port for launching the service: 514, the same as in the i3 pro system settings
- 2. start Syslog Server
Set i3 pro to connect to Syslog Server:
- 1. Turn on Remote Debugging option in the Debug tag of the settings windows of a panel project, enter the Host - IP address of a PC where Syslog Server is launched. Logging port - 514. Enter the depth of logging of iRidium systems and subsystems in iRidium Studio. There are several levels of logging depth from EMERGENCY (only errors) to DEBUG (detailed information).
- 2. Set the depth of logging for each driver added to a project.
- 3. Remote logging of i3 pro can be set not only in a project on a PC, but also in the system menu of i3 pro using one of the following ways. Click the right mouse button on the panel in iRidium Transfer and open the menu with the help of Show System Menu, long press on the empy area of workspace or a swipe from left to right.
Activtae remote logging Enable in the Remove debug tab and enter the Host - IP- address of a PC with Syslog Server, port (514) and logging level.
Apple iOS, Mac OS X, Google Android
i3 pro for iOS, Android and Mac (unlike for Windows) does not allow you to see the system log directly in the application. That is why Remote logging is used:
Remote logging
The i3 pro log can be sent to a remote PC. The sending of the log is performed with the help of special programs for registration of the system log which are called Syslog Server. Example of such program: www.winsyslog.com.
Install and set up the server:
- 1. enter the UDP-port for launching the service: 514, the same as in the i3 pro system settings
- 2. start Syslog Server
Set the i3 pro to connect to Syslog Server:
- 1. Open the Debug tab' in the panel settings window and turn on the Remote Debugging' option, enter Host - IP address of a PC where Syslog Server is launched. Logging port is - 514. Set the depth of logging of iRidium systems and subsystems in iRidium Studio. The depth of logging has several levels from EMERGENCY (only errors) to DEBUG (detailed info).
- 2. Set the depth of logging for each driver added to the project.
- 3. Remote logging of i3 pro can be set not only in a project on a PC, but also in the system menu of i3 pro using one of the following ways. Click the right mouse button on the panel in iRidium Transfer and open the menu with the help of Show System Menu, long press on the empy area of workspace or a swipe from left to right.
Activtae remote logging Enable in the Remove debug tab and enter the Host - IP- address of a PC with Syslog Server, port (514) and logging level.
Special feature for Android
Debugging via USB
It allows you to save the log file of i3 pro work on Android in a text file. The saved log can be used for detecting errors in program work.
See Android USB Debugging
Getting Data about App Work
Press F3 to see data on the app work with the memory.
- In a project on a mobile device:
Open the system menu, go to the "Screen" tab, select "Show FPS":
After turning on data on the app work appears:
- FPS - number of frames per second;
- SPRITES -memory for sprites in Kb (there is a special garbage collector for them);
- count - number of sprites (it is limited but can be increased in the system menu);
- free - number of free sprites.
- MEMORY - total RAM of the device (0 is always displayed on Android devices);
- SCRIPT:
The first number is the total memor services by the garbage collector in Kb (100-150 Mb is normal). If a projest is empty, use of memory by system scripts will be shown (for example, a menu);
The second number is the currently used memory, that is a volume used by a grbage collector in Kb (gabage is collected at 8 Mb);