- Enabling the runtime log
- Activation in the application directly through programming
- Activation without modifying the application, via a specific file
- Viewing the runtime log
- Information displayed
The runtime log is the best way to identify the most used features of an application. The runtime log is a runtime trace. This log is a simple file that contains the details of all the operations performed by a user in a WINDEV or WINDEV Mobile application or in a WEBDEV site:
- details about the processes called,
- WLanguage functions with their parameters,
- user procedures with their parameters,
This file allows you to:
New in version 28
analyze the performance of the application.
- identify the most frequent actions in the application.
- determine which processes take the longest.
- follow the code run during a process that triggers problems (hard to isolate in test mode).
The development team understands which parts of the application are the most frequently used and can focus its resources on the code to optimize.
Remark: Until version 27, the runtime log was a ".wlog" file. Starting with version 28, the runtime log contains a ".wxl" file, a ".ndx" file and a ".mmo" file.
Enabling the runtime log
The activation of the runtime log can be performed:
- in the application directly, through programming.
- without modifying the application, via a specific file
Activation in the application directly through programming
This activation is performed by dbgEnableLog
. Several WLanguage functions are used to manage the runtime log:
|dbgEnableLog||Enables the management of the runtime log.|
|dbgLogOption||Allows you to find out and modify the options of the runtime log.|
|dbgLogStatus||Allows you to find out and modify the status of the runtime log (enabled, disabled, paused).|
Activation without modifying the application, via a specific file
To do so, create a file named <Executable Name>.WX beside the executable of the application. This file must contain the following lines:
File=<Name of the log file>
Option=<Value of options>
Let's study these lines:
- Active: This parameter must correspond to 0 to disable the log and to 1 to enable it.
- File: Name of the log file. This name can be built with the following elements:
|[%ExeDir%]||Directory of the executable, always filled with the "\" character. This directory is equivalent to the result of fExeDir.|
|[%Date%]||Start date of Log file.|
|[%Time%]||Start time of Log file.|
|[%UserName%]||Name of the current user.|
|[%DataDir%]||Directory of the HFSQL data files specified by the user when installing the application. This directory is equivalent to the result of fDataDir.|
|[%DirUserData%]||Directory for the data of the current user of the current application. This directory is equivalent to the result of fDataDirUser.|
- Option: Options of the log file.
- If the options are not specified in the WX file (the OPTION line is missing), the log file is created with the default options: only the WLanguage functions are found in the log file.
- "" (empty string): Only the processes are stored in the log.
- "*": the log contains the full information.
- a combination of values:
- "+F" to enable the trace for the functions,
- "+P" to enable the trace for the parameters.
Depending on the purpose of the runtime log, its implementation as well as the options may change:
- To find out the most frequently used options of an application, we recommend that you use a simple runtime log (without the details of the functions called). The more options you request, the larger the runtime log will be.
You can enable runtime logs with the ".WX" file.
- To trace a problem that is difficult to reproduce, we recommend that you use the WLanguage functions to implement the runtime log. The runtime log will be enabled at the beginning of the section that is causing problem.
To view the runtime log:
- Open the desired project in the editor: the current project must be the application or one of the components used by the application. Only the information regarding the current project will be displayed.
- Open the runtime log file in the WINDEV, WEBDEV or WINDEV Mobile editor:
- by dragging the ".wxl" or ".wlog" file and dropping it onto the window or page editor (on the open document tabs, for example).
- by directly opening the ".wxl" or ".wlog" file.
Reminder: To open a file from the editor, go to the "Home" tab, "General" group, expand "Open" and select the desired file.
- Select the data you want to see.
The following information can be displayed from the runtime log:
- General information about the log file: name, application, start date and time, end date and time.
New in version 28
Analyze performance based on a runtime log file: Shows the activity of the application during use. The chart uses two states: The high level represents active time and the low level represents idle time. For each top level, it is possible to visualize the procedures executed and the details of the WLanguage functions used.
For more details, see Real-time performance profiler (RTPP)
- Most used elements: different tabs are displayed:
- Statistics of elements: Shows the most frequently used elements of your project, with their use time and the number of processes performed. Selecting an element allows you to:
- see the locations from which an element is used (in the bottom section of the screen)
- see the elements in the editor ("Show the element" button)
- access the statistics of the processes ("Process statistics" button).
- Process statistics: Shows time statistics per process. You can also filter the information about a specific project element.
The reason for the call is displayed at the bottom of the screen (user action, etc.). The sequence of the call can be viewed for the selected element ("Sequence of calls" button).
The "Show the process code" button is used to display the corresponding WLanguage code in the code editor. Please note that the log window is always in the foreground.
- Sequence of calls: Shows the sequence of processes performed in the selected code. The details of the functions used are displayed.
Additional information can be displayed at the bottom of the screen: Parameters of the procedure, result, ...
The "Show the call code" button is used to display the calling code. The "Recenter on process" button is used to view the code of the current process.
- Call log: Used to see all the calls to the WLanguage procedures and functions.
Additional information can be displayed at the bottom of the screen: parameters of the procedure, result, ...
The "Show the process code" button shows the corresponding WLanguage code in the code editor. Please note that the log window is always in the foreground.
- Threads: Allows you to select the thread you want to analyze and shows sequence of calls for that thread.
This page is also available for…