public function UltimateCronLogEntry::watchdog in Ultimate Cron 7.2
Implements hook_watchdog().
Capture watchdog message and append it to the log entry.
1 call to UltimateCronLogEntry::watchdog()
- UltimateCronLogEntry::log in ./
ultimate_cron.plugin.inc - Re-implementation of watchdog().
File
- ./
ultimate_cron.plugin.inc, line 1453 - Plugin framework for Ultimate Cron.
Class
- UltimateCronLogEntry
- Abstract class for Ultimate Cron log entries.
Code
public function watchdog(array $log_entry) {
if (isset($log_entry['variables']) && is_array($log_entry['variables'])) {
$this->message .= t($log_entry['message'], $log_entry['variables']) . "\n";
}
else {
$this->message .= $log_entry['message'];
}
if ($this->severity < 0 || $this->severity > $log_entry['severity']) {
$this->severity = $log_entry['severity'];
}
// Make sure that message doesn't become too big.
if (mb_strlen($this->message) > $this->log_entry_size) {
while (mb_strlen($this->message) > $this->log_entry_size) {
$firstline = mb_strpos(rtrim($this->message, "\n"), "\n");
if ($firstline === FALSE || $firstline == mb_strlen($this->message)) {
// Only one line? That's a big line ... truncate it without mercy!
$this->message = mb_substr($this->message, -$this->log_entry_size);
break;
}
$this->message = substr($this->message, $firstline + 1);
}
$this->message = '.....' . $this->message;
}
}