ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Debug functions
  • Operating mode of dynamic audit
  • Miscellaneous
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
dbgEnableAudit (Function)
In french: dbgActiveAudit
Enables the dynamic audit through programming.
The report of the dynamic audit is a ".waudit" file containing the invalid or abnormal behaviors, the time-consuming operations, ... For example:
  • the assertions (even if they are not active).
  • the non-fatal errors not processed.
  • the fatal errors (exceptions), regardless they are processed by WHEN EXCEPTION or not.
  • the execution warnings regarding the anomalies of the project (exceeding the capacity of a variable, ...).
  • the execution warnings regarding the performance problems (resources found on a network and not found, ...).
  • the custom execution comments and warnings.
Remark: If the project corresponding to the dynamic audit is opened in the editor, the audit file can be directly opened in the editor:
  • on the "Home" tab, in the "General" group, expand "Open", select "Open" and select the desired ".waudit" file.
  • by performing a Drag and Drop of ".waudit" file from the file explorer to the editor.
Example
// Enables the dynamic audit with all the options enabled
dbgEnableAudit()
Syntax
<Result> = dbgEnableAudit([<Name of audit file> [, <Options>]])
<Result>: Boolean
  • True if the dynamic audit was started,
  • False otherwise.
<Name of audit file>: Optional character string
Location and name of the audit file to create. The name and location of the audit file can be:
  • fully customized.
  • built using the following keywords:
    [%ExeDir%]Directory of the executable, always filled with the "\" character. This directory is equivalent to the result of fExeDir.
    [%ExeName%]Executable name.
    [%Date%]Start date of the runtime audit (YYYYMMDD format).
    [%Time%]Start time of runtime audit (HHMMSS format).
    [%UserName%]Name of the current user.
    [%ComputerName%]Computer name.
    [%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.

By default:
  • the extension of the audit file is ".wdaudit".
  • the name of the audit file corresponds to: "[%UserDataDir%][%ExeName%]_[%Date%]_[%Time%]".
    For example: "C:\Users\Doc\AppData\Roaming\WINDEV Applications\MyApp\MyApp_20071023_130812.waudit".
Caution: If you build strings dynamically ("Allow '[% %]' in the strings" option in the "Compilation" tab of the project description, a compilation error appears (unknown identifier). In this case, each string must be preceded by '-%'. Example:
dbgEnableAudit("[%DirUserData%][%exeName%]_[%Date%]_[%Time%]")
becomes
dbgEnableAudit(-%"[%DirUserData%][%ExeName%]_[%Date%]_[%Time%]")
<Options>: Optional Integer constant (or combination of constants)
Used to configure the options of the dynamic audit:
AuditAll
(Default value)
All the audit events are written into the dynamic audit.
AuditAssertionThe assertions are written into the dynamic audit.
AuditCommentThe audit comments are written into the dynamic audit. An audit comment is written by dbgWriteCommentAudit.
AuditEnabledThe dynamic audit is immediately enabled.
AuditErrorThe non-fatal errors not processed are written into the dynamic audit.
AuditExceptionThe fatal errors, processed by WHEN EXCEPTION or not processed, are written into the dynamic audit.
AuditPauseThe dynamic audit is initialized but it is not immediately enabled. It can be enabled thereafter by dbgAuditStatus.
AuditWarningAnomalyThe execution warnings regarding the detected anomalies are written into the dynamic audit.
AuditWarningPerformanceThe execution warnings regarding performance are registered in the dynamic audit.
AuditWarningUserThe custom execution warnings are written into the dynamic audit. A custom warning is triggered by dbgWriteWarningAudit.
Remarks

Operating mode of dynamic audit

  • dbgEnableAudit must be called only once. Any other call to this function will have no effect.
  • To temporarily enable or disable the dynamic audit, use dbgAuditStatus.
  • To modify the options of the dynamic audit, use dbgAuditOption.
WINDEV Remark: The dynamic audit can also be started via the ".wx" file next to the executable. For more details, see Dynamic audit.

Miscellaneous

  • dbgEnableAudit can be used in a REST webservice.
  • You can define any location for the audit file. In this case, keep in mind there may be permission-related issues.
    Reminder: Generally, the data directory is accessible in write mode.
Component: wd290vm.dll
Minimum version required
  • Version 15
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/03/2023

Send a report | Local help