// 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 of the audit file can be built from the following elements: | |
[%ExeDir%] | Directory of 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 current user. |
[%ComputerName%] | Computer name. |
Versions 18 and later[%DataDir%] New in version 18[%DataDir%] [%DataDir%] | Directory of HFSQL data files specified by the user when installing the application. This directory is equivalent to the result of fDataDir. |
Versions 18 and later[%DirUserData%] New in version 18[%DirUserData%] [%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".
Versions 22 and laterCaution: If you use the dynamic string construction ("Allow "[% %]" in the strings" in the "Compilation" tab of the project description), a compilation error occurs (unknown identifier). In this case, each string must be preceded by '-%'. Example:
dbgEnableAudit("[%DirUserData%][%exeName%]_[%Date%]_[%Time%]")
becomes
dbgEnableAudit(-%"[%DirUserData%][%ExeName%]_[%Date%]_[%Time%]")
New in version 22Caution: If you use the dynamic string construction ("Allow "[% %]" in the strings" in the "Compilation" tab of the project description), a compilation error occurs (unknown identifier). In this case, each string must be preceded by '-%'. Example:
dbgEnableAudit("[%DirUserData%][%exeName%]_[%Date%]_[%Time%]")
becomes
dbgEnableAudit(-%"[%DirUserData%][%ExeName%]_[%Date%]_[%Time%]")
Caution: If you use the dynamic string construction ("Allow "[% %]" in the strings" in the "Compilation" tab of the project description), a compilation error occurs (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: | |
AuditEnabled | The dynamic audit is immediately enabled. |
AuditAssertion | The assertions are written into the dynamic audit. |
AuditComment | The audit comments are written into the dynamic audit. An audit comment is written by dbgWriteCommentAudit. |
AuditError | The non-fatal errors not processed are written into the dynamic audit. |
AuditException | The fatal errors, processed by WHEN EXCEPTION or not processed, are written into the dynamic audit. |
AuditPause | The dynamic audit is initialized but it is not immediately enabled. It can be enabled thereafter by dbgAuditStatus. |
AuditAll (Default value) | All the audit events are written into the dynamic audit. |
AuditWarningAnomaly | The execution warnings regarding the detected anomalies are written into the dynamic audit. |
AuditWarningPerformance | The execution warnings regarding performance are registered in the dynamic audit. |
AuditWarningUser | The 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 once only. 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.