Replaced deprecated "log" function call

This commit is contained in:
Michael 2021-11-03 23:19:24 +00:00
parent 9f411b0c76
commit 24ee87224f
14 changed files with 101 additions and 160 deletions

View file

@ -64,7 +64,7 @@ class PushSubscriber
$priority = $default_priority;
}
Logger::log('Publish feed to ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' with priority ' . $priority, Logger::DEBUG);
Logger::info('Publish feed to ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' with priority ' . $priority);
Worker::add($priority, 'PubSubPublish', (int)$subscriber['id']);
}
@ -108,9 +108,9 @@ class PushSubscriber
'secret' => $hub_secret];
DBA::insert('push_subscriber', $fields);
Logger::log("Successfully subscribed [$hub_callback] for $nick");
Logger::notice("Successfully subscribed [$hub_callback] for $nick");
} else {
Logger::log("Successfully unsubscribed [$hub_callback] for $nick");
Logger::notice("Successfully unsubscribed [$hub_callback] for $nick");
// we do nothing here, since the row was already deleted
}
}
@ -136,10 +136,10 @@ class PushSubscriber
if ($days > 60) {
DBA::update('push_subscriber', ['push' => -1, 'next_try' => DBA::NULL_DATETIME], ['id' => $id]);
Logger::log('Delivery error: Subscription ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' is marked as ended.', Logger::DEBUG);
Logger::info('Delivery error: Subscription ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' is marked as ended.');
} else {
DBA::update('push_subscriber', ['push' => 0, 'next_try' => DBA::NULL_DATETIME], ['id' => $id]);
Logger::log('Delivery error: Giving up ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' for now.', Logger::DEBUG);
Logger::info('Delivery error: Giving up ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' for now.');
}
} else {
// Calculate the delay until the next trial
@ -149,7 +149,7 @@ class PushSubscriber
$retrial = $retrial + 1;
DBA::update('push_subscriber', ['push' => $retrial, 'next_try' => $next], ['id' => $id]);
Logger::log('Delivery error: Next try (' . $retrial . ') ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' at ' . $next, Logger::DEBUG);
Logger::info('Delivery error: Next try (' . $retrial . ') ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' at ' . $next);
}
}
@ -170,7 +170,7 @@ class PushSubscriber
// set last_update to the 'created' date of the last item, and reset push=0
$fields = ['push' => 0, 'next_try' => DBA::NULL_DATETIME, 'last_update' => $last_update];
DBA::update('push_subscriber', $fields, ['id' => $id]);
Logger::log('Subscriber ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' is marked as vital', Logger::DEBUG);
Logger::info('Subscriber ' . $subscriber['callback_url'] . ' for ' . $subscriber['nickname'] . ' is marked as vital');
$parts = parse_url($subscriber['callback_url']);
unset($parts['path']);