From 81c9d8d479f7357a1e0a77c40ffde170b39f4960 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 25 Oct 2021 21:27:21 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Hypolite Petovan --- mod/pubsub.php | 4 ++-- mod/pubsubhubbub.php | 2 +- src/Protocol/OStatus.php | 6 +++--- src/Protocol/Salmon.php | 6 +++--- src/Worker/PubSubPublish.php | 2 +- view/theme/frio/theme.php | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mod/pubsub.php b/mod/pubsub.php index 99e8015f1..3727bade9 100644 --- a/mod/pubsub.php +++ b/mod/pubsub.php @@ -107,7 +107,7 @@ function pubsub_post(App $a) { $xml = Network::postdata(); - Logger::notice('Feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . DI::args()->getCommand() . ' with user-agent: ' . $_SERVER['HTTP_USER_AGENT']); + Logger::info('Feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . DI::args()->getCommand() . ' with user-agent: ' . $_SERVER['HTTP_USER_AGENT']); Logger::debug('Data: ' . $xml); $nick = ((DI::args()->getArgc() > 1) ? Strings::escapeTags(trim(DI::args()->getArgv()[1])) : ''); @@ -149,7 +149,7 @@ function pubsub_post(App $a) hub_post_return(); } - Logger::notice('Import item for ' . $nick . ' from ' . $contact['nick'] . ' (' . $contact['id'] . ')'); + Logger::info('Import item for ' . $nick . ' from ' . $contact['nick'] . ' (' . $contact['id'] . ')'); $feedhub = ''; OStatus::import($xml, $importer, $contact, $feedhub); diff --git a/mod/pubsubhubbub.php b/mod/pubsubhubbub.php index f985bef63..2cc2394c1 100644 --- a/mod/pubsubhubbub.php +++ b/mod/pubsubhubbub.php @@ -64,7 +64,7 @@ function pubsubhubbub_init(App $a) { throw new \Friendica\Network\HTTPException\NotFoundException(); } - Logger::notice("$hub_mode request from " . $_SERVER['REMOTE_ADDR']); + Logger::info("$hub_mode request from " . $_SERVER['REMOTE_ADDR']); if (DI::args()->getArgc() > 1) { // Normally the url should now contain the nick name as last part of the url diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index 277644dcc..c40193e1b 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -535,12 +535,12 @@ class OStatus foreach (self::$itemlist as $item) { $found = Post::exists(['uid' => $importer["uid"], 'uri' => $item["uri"]]); if ($found) { - Logger::info("Item with uri ".$item["uri"]." for user ".$importer["uid"]." already exists."); + Logger::notice("Item with uri ".$item["uri"]." for user ".$importer["uid"]." already exists."); } elseif ($item['contact-id'] < 0) { - Logger::info("Item with uri ".$item["uri"]." is from a blocked contact."); + Logger::notice("Item with uri ".$item["uri"]." is from a blocked contact."); } else { $ret = Item::insert($item); - Logger::notice("Item with uri ".$item["uri"]." for user ".$importer["uid"].' stored. Return value: '.$ret); + Logger::info("Item with uri ".$item["uri"]." for user ".$importer["uid"].' stored. Return value: '.$ret); } } } diff --git a/src/Protocol/Salmon.php b/src/Protocol/Salmon.php index ebb9f1776..321b91392 100644 --- a/src/Protocol/Salmon.php +++ b/src/Protocol/Salmon.php @@ -46,7 +46,7 @@ class Salmon { $ret = []; - Logger::notice('Fetching salmon key for '.$uri); + Logger::info('Fetching salmon key for '.$uri); $arr = Probe::lrdd($uri); @@ -121,7 +121,7 @@ class Salmon return; } - Logger::notice('slapper called for '.$url.'. Data: ' . $slap); + Logger::info('slapper called for '.$url.'. Data: ' . $slap); // create a magic envelope @@ -209,7 +209,7 @@ class Salmon $return_code = $postResult->getReturnCode(); } - Logger::notice('slapper for '.$url.' returned ' . $return_code); + Logger::info('slapper for '.$url.' returned ' . $return_code); if (! $return_code) { return -1; diff --git a/src/Worker/PubSubPublish.php b/src/Worker/PubSubPublish.php index 4b1c78bf2..49aef00c9 100644 --- a/src/Worker/PubSubPublish.php +++ b/src/Worker/PubSubPublish.php @@ -72,7 +72,7 @@ class PubSubPublish $ret = $postResult->getReturnCode(); if ($ret >= 200 && $ret <= 299) { - Logger::notice('Successfully pushed to ' . $subscriber['callback_url']); + Logger::info('Successfully pushed to ' . $subscriber['callback_url']); PushSubscriber::reset($subscriber['id'], $last_update); } else { diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php index 3ea1e1641..138bfdc2a 100644 --- a/view/theme/frio/theme.php +++ b/view/theme/frio/theme.php @@ -57,7 +57,7 @@ function frio_install() Hook::register('nav_info', 'view/theme/frio/theme.php', 'frio_remote_nav'); Hook::register('display_item', 'view/theme/frio/theme.php', 'frio_display_item'); - Logger::notice('installed theme frio'); + Logger::info('installed theme frio'); } /**