LoggerBase.php in Ultimate Cron 8.2
File
src/Logger/LoggerBase.php
View source
<?php
namespace Drupal\ultimate_cron\Logger;
use Drupal\ultimate_cron\CronPlugin;
abstract class LoggerBase extends CronPlugin implements LoggerInterface {
public static $log_entries = NULL;
public function factoryLogEntry($name) {
return new LogEntry($name, $this);
}
public function createEntry($name, $lock_id, $init_message = '', $log_type = ULTIMATE_CRON_LOG_TYPE_NORMAL) {
$log_entry = new LogEntry($name, $this, $log_type);
$log_entry->lid = $lock_id;
$log_entry->start_time = microtime(TRUE);
$log_entry->init_message = $init_message;
return $log_entry;
}
public function loadLatestLogEntries(array $jobs, array $log_types) {
$logs = array();
foreach ($jobs as $job) {
$logs[$job
->id()] = $job
->loadLatestLogEntry($log_types);
}
return $logs;
}
}