function log_cleanup_cron in Util 6.3
Same name and namespace in other branches
- 7 contribs/log_cleanup/log_cleanup.module \log_cleanup_cron()
Implementation of hook_cron(). Clean up a few things from watchdog.
1 call to log_cleanup_cron()
- _log_cleanup_manual in contribs/
log_cleanup/ log_cleanup.module - Code for manual invocation.
File
- contribs/
log_cleanup/ log_cleanup.module, line 24 - Clean up watchdog messages.
Code
function log_cleanup_cron() {
$cleaned = array();
$requests = variable_get('log_cleanup_intervals', array());
foreach ($requests as $type => $interval) {
// Interval < 0 means skip it.
if ($interval >= 0) {
$count = _log_cleanup_main($type, $interval);
if ($count) {
$cleaned[] = $type . ' ' . $count . ' (' . format_interval($interval) . ')';
}
}
}
if ($cleaned) {
watchdog('Cleanup', 'Deleted watchdog: @deletes', array(
'@deletes' => implode(', ', $cleaned),
));
}
}