Documentation
UC_ResetLastLogMessages
bool UC_ResetLastLogMessages (int $InstanceID)
Parameters
| InstanceID | ID for the Util Control |
Returns
If the command succeeds, it returns TRUE, otherwise FALSE.
Description
The function clears the buffers of all message types whose content is returned by UC_GetLastLogMessages. Afterwards UC_GetLastLogMessages only returns messages that were written to the log after the call. The log or the log files themselves are not changed.
The counters of UC_GetLogMessageStatistics are kept, they are reset with UC_ResetLogMessageStatistics.
The ID of the Util Control instance can be determined e.g. with IPS_GetInstanceListByModuleID and the module GUID {B69010EA-96D5-46DF-B885-24821B8C8DBD}. If InstanceID does not exist, the function fails with "Instance #... does not exist", if the instance belongs to another module, with "Instance does not implement this function".
Example
// Determine the ID of the Util Control instance
$id = IPS_GetInstanceListByModuleID('{B69010EA-96D5-46DF-B885-24821B8C8DBD}')[0];
UC_ResetLastLogMessages($id);
// Now returns an empty array until another error message occurs
print_r(UC_GetLastLogMessages($id, KL_ERROR - KL_MESSAGE));