Added source logging to cron upload output when all sources are enabled

This commit is contained in:
Matthew Barbour 2020-06-14 10:37:08 -05:00 committed by Shish
parent 18cd74f57d
commit f6923af8ab

View file

@ -119,11 +119,12 @@ class CronUploader extends Extension
public function onLog(LogEvent $event)
{
global $config;
$all = $config->get_bool(CronUploaderConfig::INCLUDE_ALL_LOGS);
if (self::$IMPORT_RUNNING &&
$event->priority >= $config->get_int(CronUploaderConfig::LOG_LEVEL) &&
($event->section==self::NAME || $config->get_bool(CronUploaderConfig::INCLUDE_ALL_LOGS))
($event->section==self::NAME || $all)
) {
$output = "[" . date('Y-m-d H:i:s') . "] [" . LOGGING_LEVEL_NAMES[$event->priority] . "] " . $event->message ;
$output = "[" . date('Y-m-d H:i:s') . "] " . ($all ? '['. $event->section .'] ' :'') . "[" . LOGGING_LEVEL_NAMES[$event->priority] . "] " . $event->message ;
echo $output . "\r\n";
flush_output();