1
0
Fork 0

Merge pull request #10951 from friendica/logs

Replaced deprecated "log" function call
This commit is contained in:
Tobias Diekershoff 2021-11-04 07:52:46 +01:00 committed by GitHub
commit 13997c8c10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 101 additions and 160 deletions

View file

@ -105,12 +105,12 @@ class Delivery
DBA::close($itemdata);
if (empty($target_item)) {
Logger::log('Item ' . $target_id . "wasn't found. Quitting here.");
Logger::notice('Item ' . $target_id . "wasn't found. Quitting here.");
return;
}
if (empty($parent)) {
Logger::log('Parent ' . $parent_id . ' for item ' . $target_id . "wasn't found. Quitting here.");
Logger::notice('Parent ' . $parent_id . ' for item ' . $target_id . "wasn't found. Quitting here.");
self::setFailedQueue($cmd, $target_item);
return;
}
@ -120,7 +120,7 @@ class Delivery
} elseif (!empty($target_item['uid'])) {
$uid = $target_item['uid'];
} else {
Logger::log('Only public users for item ' . $target_id, Logger::DEBUG);
Logger::info('Only public users for item ' . $target_id);
self::setFailedQueue($cmd, $target_item);
return;
}
@ -169,7 +169,7 @@ class Delivery
*/
if (!$top_level && ($parent['wall'] == 0) && stristr($target_item['uri'], $localhost)) {
Logger::log('Followup ' . $target_item["guid"], Logger::DEBUG);
Logger::info('Followup ' . $target_item["guid"]);
// local followup to remote post
$followup = true;
}
@ -419,22 +419,22 @@ class Delivery
$deliver_status = Diaspora::sendAccountMigration($owner, $contact, $owner['uid']);
} elseif ($target_item['deleted'] && (($target_item['uri'] === $target_item['parent-uri']) || $followup)) {
// top-level retraction
Logger::log('diaspora retract: ' . $loc);
Logger::notice('diaspora retract: ' . $loc);
$deliver_status = Diaspora::sendRetraction($target_item, $owner, $contact, $public_message);
} elseif ($followup) {
// send comments and likes to owner to relay
Logger::log('diaspora followup: ' . $loc);
Logger::notice('diaspora followup: ' . $loc);
$deliver_status = Diaspora::sendFollowup($target_item, $owner, $contact, $public_message);
} elseif ($target_item['uri'] !== $target_item['parent-uri']) {
// we are the relay - send comments, likes and relayable_retractions to our conversants
Logger::log('diaspora relay: ' . $loc);
Logger::notice('diaspora relay: ' . $loc);
$deliver_status = Diaspora::sendRelay($target_item, $owner, $contact, $public_message);
} elseif ($top_level && !$walltowall) {
// currently no workable solution for sending walltowall
Logger::log('diaspora status: ' . $loc);
Logger::notice('diaspora status: ' . $loc);
$deliver_status = Diaspora::sendStatus($target_item, $owner, $contact, $public_message);
} else {
Logger::log('Unknown mode ' . $cmd . ' for ' . $loc);
Logger::notice('Unknown mode ' . $cmd . ' for ' . $loc);
return;
}

View file

@ -296,7 +296,7 @@ class Notifier
$push_notify = false;
}
Logger::log('Notify ' . $target_item["guid"] .' via PuSH: ' . ($push_notify ? "Yes":"No"), Logger::DEBUG);
Logger::info('Notify ' . $target_item["guid"] .' via PuSH: ' . ($push_notify ? "Yes":"No"));
} elseif ($exclusive_delivery) {
$followup = true;
@ -315,7 +315,7 @@ class Notifier
// don't send deletions onward for other people's stuff
if ($target_item['deleted'] && !intval($target_item['wall'])) {
Logger::log('Ignoring delete notification for non-wall item');
Logger::notice('Ignoring delete notification for non-wall item');
return;
}
@ -385,7 +385,7 @@ class Notifier
if (($thr_parent && ($thr_parent['network'] == Protocol::OSTATUS)) || ($parent['network'] == Protocol::OSTATUS)) {
$diaspora_delivery = false;
Logger::log('Some parent is OStatus for '.$target_item["guid"]." - Author: ".$thr_parent['author-id']." - Owner: ".$thr_parent['owner-id'], Logger::DEBUG);
Logger::info('Some parent is OStatus for '.$target_item["guid"]." - Author: ".$thr_parent['author-id']." - Owner: ".$thr_parent['owner-id']);
// Send a salmon to the parent author
$probed_contact = DBA::selectFirst('contact', ['url', 'notify'], ['id' => $thr_parent['author-id']]);
@ -490,7 +490,7 @@ class Notifier
$delivery_queue_count += self::deliverOStatus($target_id, $target_item, $owner, $url_recipients, $public_message, $push_notify);
if (!empty($target_item)) {
Logger::log('Calling hooks for ' . $cmd . ' ' . $target_id, Logger::DEBUG);
Logger::info('Calling hooks for ' . $cmd . ' ' . $target_id);
Hook::fork($a->getQueueValue('priority'), 'notifier_normal', $target_item);
@ -767,12 +767,12 @@ class Notifier
$relay_inboxes = ActivityPub\Transmitter::addRelayServerInboxes();
}
Logger::log('Origin item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' will be distributed.', Logger::DEBUG);
Logger::info('Origin item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' will be distributed.');
} elseif (Item::isForumPost($target_item, $owner)) {
$inboxes = ActivityPub\Transmitter::fetchTargetInboxes($target_item, $uid, false, 0, true);
Logger::log('Forum item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' will be distributed.', Logger::DEBUG);
Logger::info('Forum item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' will be distributed.');
} elseif (!DBA::exists('conversation', ['item-uri' => $target_item['uri'], 'protocol' => Conversation::PARCEL_ACTIVITYPUB])) {
Logger::log('Remote item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' is no AP post. It will not be distributed.', Logger::DEBUG);
Logger::info('Remote item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' is no AP post. It will not be distributed.');
return ['count' => 0, 'contacts' => []];
} elseif ($parent['origin']) {
// Remote items are transmitted via the personal inboxes.
@ -784,11 +784,11 @@ class Notifier
$relay_inboxes = ActivityPub\Transmitter::addRelayServerInboxes([]);
}
Logger::log('Remote item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' will be distributed.', Logger::DEBUG);
Logger::info('Remote item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' will be distributed.');
}
if (empty($inboxes) && empty($relay_inboxes)) {
Logger::log('No inboxes found for item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . '. It will not be distributed.', Logger::DEBUG);
Logger::info('No inboxes found for item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . '. It will not be distributed.');
return ['count' => 0, 'contacts' => []];
}

View file

@ -231,7 +231,7 @@ class OnePoll
$metas = Email::messageMeta($mbox, implode(',', $msgs));
if (count($metas) != count($msgs)) {
Logger::log("for " . $mailconf['user'] . " there are ". count($msgs) . " messages but received " . count($metas) . " metas", Logger::DEBUG);
Logger::info("for " . $mailconf['user'] . " there are ". count($msgs) . " messages but received " . count($metas) . " metas");
} else {
$msgs = array_combine($msgs, $metas);
@ -253,7 +253,7 @@ class OnePoll
$condition = ['uid' => $importer_uid, 'uri' => $datarray['uri']];
$item = Post::selectFirst($fields, $condition);
if (DBA::isResult($item)) {
Logger::log("Mail: Seen before ".$msg_uid." for ".$mailconf['user']." UID: ".$importer_uid." URI: ".$datarray['uri'],Logger::DEBUG);
Logger::info("Mail: Seen before ".$msg_uid." for ".$mailconf['user']." UID: ".$importer_uid." URI: ".$datarray['uri']);
// Only delete when mails aren't automatically moved or deleted
if (($mailconf['action'] != 1) && ($mailconf['action'] != 3))
@ -264,18 +264,18 @@ class OnePoll
switch ($mailconf['action']) {
case 0:
Logger::log("Mail: Seen before ".$msg_uid." for ".$mailconf['user'].". Doing nothing.", Logger::DEBUG);
Logger::info("Mail: Seen before ".$msg_uid." for ".$mailconf['user'].". Doing nothing.");
break;
case 1:
Logger::log("Mail: Deleting ".$msg_uid." for ".$mailconf['user']);
Logger::notice("Mail: Deleting ".$msg_uid." for ".$mailconf['user']);
imap_delete($mbox, $msg_uid, FT_UID);
break;
case 2:
Logger::log("Mail: Mark as seen ".$msg_uid." for ".$mailconf['user']);
Logger::notice("Mail: Mark as seen ".$msg_uid." for ".$mailconf['user']);
imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID);
break;
case 3:
Logger::log("Mail: Moving ".$msg_uid." to ".$mailconf['movetofolder']." for ".$mailconf['user']);
Logger::notice("Mail: Moving ".$msg_uid." to ".$mailconf['movetofolder']." for ".$mailconf['user']);
imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID);
if ($mailconf['movetofolder'] != "") {
imap_mail_move($mbox, $msg_uid, $mailconf['movetofolder'], FT_UID);
@ -387,28 +387,28 @@ class OnePoll
$datarray = Email::getMessage($mbox, $msg_uid, $reply, $datarray);
if (empty($datarray['body'])) {
Logger::log("Mail: can't fetch msg ".$msg_uid." for ".$mailconf['user']);
Logger::notice("Mail: can't fetch msg ".$msg_uid." for ".$mailconf['user']);
continue;
}
Logger::log("Mail: Importing ".$msg_uid." for ".$mailconf['user']);
Logger::notice("Mail: Importing ".$msg_uid." for ".$mailconf['user']);
Item::insert($datarray);
switch ($mailconf['action']) {
case 0:
Logger::log("Mail: Seen before ".$msg_uid." for ".$mailconf['user'].". Doing nothing.", Logger::DEBUG);
Logger::info("Mail: Seen before ".$msg_uid." for ".$mailconf['user'].". Doing nothing.");
break;
case 1:
Logger::log("Mail: Deleting ".$msg_uid." for ".$mailconf['user']);
Logger::notice("Mail: Deleting ".$msg_uid." for ".$mailconf['user']);
imap_delete($mbox, $msg_uid, FT_UID);
break;
case 2:
Logger::log("Mail: Mark as seen ".$msg_uid." for ".$mailconf['user']);
Logger::notice("Mail: Mark as seen ".$msg_uid." for ".$mailconf['user']);
imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID);
break;
case 3:
Logger::log("Mail: Moving ".$msg_uid." to ".$mailconf['movetofolder']." for ".$mailconf['user']);
Logger::notice("Mail: Moving ".$msg_uid." to ".$mailconf['movetofolder']." for ".$mailconf['user']);
imap_setflag_full($mbox, $msg_uid, "\\Seen", ST_UID);
if ($mailconf['movetofolder'] != "") {
imap_mail_move($mbox, $msg_uid, $mailconf['movetofolder'], FT_UID);