Replace deprecated log calls

This commit is contained in:
Michael 2021-10-20 18:53:52 +00:00
parent 353cd66b26
commit f6faae5bb1
28 changed files with 163 additions and 163 deletions

View File

@ -99,7 +99,7 @@ function display_init(App $a)
} }
if (!empty($_SERVER['HTTP_ACCEPT']) && strstr($_SERVER['HTTP_ACCEPT'], 'application/atom+xml')) { if (!empty($_SERVER['HTTP_ACCEPT']) && strstr($_SERVER['HTTP_ACCEPT'], 'application/atom+xml')) {
Logger::log('Directly serving XML for uri-id '.$item['uri-id'], Logger::DEBUG); Logger::info('Directly serving XML for uri-id '.$item['uri-id']);
displayShowFeed($item['uri-id'], $item['uid'], false); displayShowFeed($item['uri-id'], $item['uid'], false);
} }

View File

@ -59,14 +59,14 @@ function pubsub_init(App $a)
$hub_challenge = Strings::escapeTags(trim($_GET['hub_challenge'] ?? '')); $hub_challenge = Strings::escapeTags(trim($_GET['hub_challenge'] ?? ''));
$hub_verify = Strings::escapeTags(trim($_GET['hub_verify_token'] ?? '')); $hub_verify = Strings::escapeTags(trim($_GET['hub_verify_token'] ?? ''));
Logger::log('Subscription from ' . $_SERVER['REMOTE_ADDR'] . ' Mode: ' . $hub_mode . ' Nick: ' . $nick); Logger::notice('Subscription from ' . $_SERVER['REMOTE_ADDR'] . ' Mode: ' . $hub_mode . ' Nick: ' . $nick);
Logger::log('Data: ' . print_r($_GET,true), Logger::DATA); Logger::debug('Data: ', ['get' => $_GET]);
$subscribe = (($hub_mode === 'subscribe') ? 1 : 0); $subscribe = (($hub_mode === 'subscribe') ? 1 : 0);
$owner = DBA::selectFirst('user', ['uid'], ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]); $owner = DBA::selectFirst('user', ['uid'], ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]);
if (!DBA::isResult($owner)) { if (!DBA::isResult($owner)) {
Logger::log('Local account not found: ' . $nick); Logger::notice('Local account not found: ' . $nick);
hub_return(false, ''); hub_return(false, '');
} }
@ -78,12 +78,12 @@ function pubsub_init(App $a)
$contact = DBA::selectFirst('contact', ['id', 'poll'], $condition); $contact = DBA::selectFirst('contact', ['id', 'poll'], $condition);
if (!DBA::isResult($contact)) { if (!DBA::isResult($contact)) {
Logger::log('Contact ' . $contact_id . ' not found.'); Logger::notice('Contact ' . $contact_id . ' not found.');
hub_return(false, ''); hub_return(false, '');
} }
if (!empty($hub_topic) && !Strings::compareLink($hub_topic, $contact['poll'])) { if (!empty($hub_topic) && !Strings::compareLink($hub_topic, $contact['poll'])) {
Logger::log('Hub topic ' . $hub_topic . ' != ' . $contact['poll']); Logger::notice('Hub topic ' . $hub_topic . ' != ' . $contact['poll']);
hub_return(false, ''); hub_return(false, '');
} }
@ -91,13 +91,13 @@ function pubsub_init(App $a)
// Don't allow outsiders to unsubscribe us. // Don't allow outsiders to unsubscribe us.
if (($hub_mode === 'unsubscribe') && empty($hub_verify)) { if (($hub_mode === 'unsubscribe') && empty($hub_verify)) {
Logger::log('Bogus unsubscribe'); Logger::notice('Bogus unsubscribe');
hub_return(false, ''); hub_return(false, '');
} }
if (!empty($hub_mode)) { if (!empty($hub_mode)) {
Contact::update(['subhub' => $subscribe], ['id' => $contact['id']]); Contact::update(['subhub' => $subscribe], ['id' => $contact['id']]);
Logger::log($hub_mode . ' success for contact ' . $contact_id . '.'); Logger::notice($hub_mode . ' success for contact ' . $contact_id . '.');
} }
hub_return(true, $hub_challenge); hub_return(true, $hub_challenge);
} }
@ -107,8 +107,8 @@ function pubsub_post(App $a)
{ {
$xml = Network::postdata(); $xml = Network::postdata();
Logger::log('Feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . DI::args()->getCommand() . ' with user-agent: ' . $_SERVER['HTTP_USER_AGENT']); Logger::notice('Feed arrived from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . DI::args()->getCommand() . ' with user-agent: ' . $_SERVER['HTTP_USER_AGENT']);
Logger::log('Data: ' . $xml, Logger::DATA); Logger::debug('Data: ' . $xml);
$nick = ((DI::args()->getArgc() > 1) ? Strings::escapeTags(trim(DI::args()->getArgv()[1])) : ''); $nick = ((DI::args()->getArgc() > 1) ? Strings::escapeTags(trim(DI::args()->getArgv()[1])) : '');
$contact_id = ((DI::args()->getArgc() > 2) ? intval(DI::args()->getArgv()[2]) : 0 ); $contact_id = ((DI::args()->getArgc() > 2) ? intval(DI::args()->getArgv()[2]) : 0 );
@ -126,10 +126,10 @@ function pubsub_post(App $a)
if (!empty($author['contact-id'])) { if (!empty($author['contact-id'])) {
$condition = ['id' => $author['contact-id'], 'uid' => $importer['uid'], 'subhub' => true, 'blocked' => false]; $condition = ['id' => $author['contact-id'], 'uid' => $importer['uid'], 'subhub' => true, 'blocked' => false];
$contact = DBA::selectFirst('contact', [], $condition); $contact = DBA::selectFirst('contact', [], $condition);
Logger::log('No record for ' . $nick .' with contact id ' . $contact_id . ' - using '.$author['contact-id'].' instead.'); Logger::notice('No record for ' . $nick .' with contact id ' . $contact_id . ' - using '.$author['contact-id'].' instead.');
} }
if (!DBA::isResult($contact)) { if (!DBA::isResult($contact)) {
Logger::log('Contact ' . $author["author-link"] . ' (' . $contact_id . ') for user ' . $nick . " wasn't found - ignored. XML: " . $xml); Logger::notice('Contact ' . $author["author-link"] . ' (' . $contact_id . ') for user ' . $nick . " wasn't found - ignored. XML: " . $xml);
hub_post_return(); hub_post_return();
} }
} }
@ -139,7 +139,7 @@ function pubsub_post(App $a)
} }
if (!in_array($contact['rel'], [Contact::SHARING, Contact::FRIEND]) && ($contact['network'] != Protocol::FEED)) { if (!in_array($contact['rel'], [Contact::SHARING, Contact::FRIEND]) && ($contact['network'] != Protocol::FEED)) {
Logger::log('Contact ' . $contact['id'] . ' is not expected to share with us - ignored.'); Logger::notice('Contact ' . $contact['id'] . ' is not expected to share with us - ignored.');
hub_post_return(); hub_post_return();
} }
@ -149,7 +149,7 @@ function pubsub_post(App $a)
hub_post_return(); hub_post_return();
} }
Logger::log('Import item for ' . $nick . ' from ' . $contact['nick'] . ' (' . $contact['id'] . ')'); Logger::notice('Import item for ' . $nick . ' from ' . $contact['nick'] . ' (' . $contact['id'] . ')');
$feedhub = ''; $feedhub = '';
OStatus::import($xml, $importer, $contact, $feedhub); OStatus::import($xml, $importer, $contact, $feedhub);

View File

@ -60,11 +60,11 @@ function pubsubhubbub_init(App $a) {
} elseif ($hub_mode === 'unsubscribe') { } elseif ($hub_mode === 'unsubscribe') {
$subscribe = 0; $subscribe = 0;
} else { } else {
Logger::log("Invalid hub_mode=$hub_mode, ignoring."); Logger::notice("Invalid hub_mode=$hub_mode, ignoring.");
throw new \Friendica\Network\HTTPException\NotFoundException(); throw new \Friendica\Network\HTTPException\NotFoundException();
} }
Logger::log("$hub_mode request from " . $_SERVER['REMOTE_ADDR']); Logger::notice("$hub_mode request from " . $_SERVER['REMOTE_ADDR']);
if (DI::args()->getArgc() > 1) { if (DI::args()->getArgc() > 1) {
// Normally the url should now contain the nick name as last part of the url // Normally the url should now contain the nick name as last part of the url
@ -77,7 +77,7 @@ function pubsubhubbub_init(App $a) {
$nick = basename($nick, '.atom'); $nick = basename($nick, '.atom');
if (!$nick) { if (!$nick) {
Logger::log('Bad hub_topic=$hub_topic, ignoring.'); Logger::notice('Bad hub_topic=$hub_topic, ignoring.');
throw new \Friendica\Network\HTTPException\NotFoundException(); throw new \Friendica\Network\HTTPException\NotFoundException();
} }
@ -85,7 +85,7 @@ function pubsubhubbub_init(App $a) {
$condition = ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]; $condition = ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false];
$owner = DBA::selectFirst('user', ['uid', 'nickname'], $condition); $owner = DBA::selectFirst('user', ['uid', 'nickname'], $condition);
if (!DBA::isResult($owner)) { if (!DBA::isResult($owner)) {
Logger::log('Local account not found: ' . $nick . ' - topic: ' . $hub_topic . ' - callback: ' . $hub_callback); Logger::notice('Local account not found: ' . $nick . ' - topic: ' . $hub_topic . ' - callback: ' . $hub_callback);
throw new \Friendica\Network\HTTPException\NotFoundException(); throw new \Friendica\Network\HTTPException\NotFoundException();
} }
@ -94,7 +94,7 @@ function pubsubhubbub_init(App $a) {
'pending' => false, 'self' => true]; 'pending' => false, 'self' => true];
$contact = DBA::selectFirst('contact', ['poll'], $condition); $contact = DBA::selectFirst('contact', ['poll'], $condition);
if (!DBA::isResult($contact)) { if (!DBA::isResult($contact)) {
Logger::log('Self contact for user ' . $owner['uid'] . ' not found.'); Logger::notice('Self contact for user ' . $owner['uid'] . ' not found.');
throw new \Friendica\Network\HTTPException\NotFoundException(); throw new \Friendica\Network\HTTPException\NotFoundException();
} }
@ -103,7 +103,7 @@ function pubsubhubbub_init(App $a) {
$self = DI::baseUrl() . '/api/statuses/user_timeline/' . $owner['nickname'] . '.atom'; $self = DI::baseUrl() . '/api/statuses/user_timeline/' . $owner['nickname'] . '.atom';
if (!Strings::compareLink($hub_topic, $contact['poll']) && !Strings::compareLink($hub_topic2, $contact['poll']) && !Strings::compareLink($hub_topic, $self)) { if (!Strings::compareLink($hub_topic, $contact['poll']) && !Strings::compareLink($hub_topic2, $contact['poll']) && !Strings::compareLink($hub_topic, $self)) {
Logger::log('Hub topic ' . $hub_topic . ' != ' . $contact['poll']); Logger::notice('Hub topic ' . $hub_topic . ' != ' . $contact['poll']);
throw new \Friendica\Network\HTTPException\NotFoundException(); throw new \Friendica\Network\HTTPException\NotFoundException();
} }
@ -131,14 +131,14 @@ function pubsubhubbub_init(App $a) {
// give up if the HTTP return code wasn't a success (2xx) // give up if the HTTP return code wasn't a success (2xx)
if ($ret < 200 || $ret > 299) { if ($ret < 200 || $ret > 299) {
Logger::log("Subscriber verification for $hub_topic at $hub_callback returned $ret, ignoring."); Logger::notice("Subscriber verification for $hub_topic at $hub_callback returned $ret, ignoring.");
throw new \Friendica\Network\HTTPException\NotFoundException(); throw new \Friendica\Network\HTTPException\NotFoundException();
} }
// check that the correct hub_challenge code was echoed back // check that the correct hub_challenge code was echoed back
if (trim($body) !== $hub_challenge) { if (trim($body) !== $hub_challenge) {
Logger::log("Subscriber did not echo back hub.challenge, ignoring."); Logger::notice("Subscriber did not echo back hub.challenge, ignoring.");
Logger::log("\"$hub_challenge\" != \"".trim($body)."\""); Logger::notice("\"$hub_challenge\" != \"".trim($body)."\"");
throw new \Friendica\Network\HTTPException\NotFoundException(); throw new \Friendica\Network\HTTPException\NotFoundException();
} }

View File

@ -76,7 +76,7 @@ function redir_init(App $a) {
// Local user is already authenticated. // Local user is already authenticated.
redir_check_url($contact_url, $url); redir_check_url($contact_url, $url);
$target_url = $url ?: $contact_url; $target_url = $url ?: $contact_url;
Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, Logger::DEBUG); Logger::info($contact['name'] . " is already authenticated. Redirecting to " . $target_url);
$a->redirect($target_url); $a->redirect($target_url);
} }
} }
@ -93,7 +93,7 @@ function redir_init(App $a) {
// Remote user is already authenticated. // Remote user is already authenticated.
redir_check_url($contact_url, $url); redir_check_url($contact_url, $url);
$target_url = $url ?: $contact_url; $target_url = $url ?: $contact_url;
Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, Logger::DEBUG); Logger::info($contact['name'] . " is already authenticated. Redirecting to " . $target_url);
$a->redirect($target_url); $a->redirect($target_url);
} }
} }
@ -112,7 +112,7 @@ function redir_init(App $a) {
$url .= $separator . 'zrl=' . urlencode($my_profile); $url .= $separator . 'zrl=' . urlencode($my_profile);
} }
Logger::log('redirecting to ' . $url, Logger::DEBUG); Logger::info('redirecting to ' . $url);
$a->redirect($url); $a->redirect($url);
} }

View File

@ -38,7 +38,7 @@ use Friendica\Util\Strings;
function wall_upload_post(App $a, $desktopmode = true) function wall_upload_post(App $a, $desktopmode = true)
{ {
Logger::log("wall upload: starting new upload", Logger::DEBUG); Logger::info("wall upload: starting new upload");
$r_json = (!empty($_GET['response']) && $_GET['response'] == 'json'); $r_json = (!empty($_GET['response']) && $_GET['response'] == 'json');
$album = trim($_GET['album'] ?? ''); $album = trim($_GET['album'] ?? '');
@ -156,8 +156,8 @@ function wall_upload_post(App $a, $desktopmode = true)
$filetype = Images::getMimeTypeBySource($src, $filename, $filetype); $filetype = Images::getMimeTypeBySource($src, $filename, $filetype);
Logger::log("File upload src: " . $src . " - filename: " . $filename . Logger::info("File upload src: " . $src . " - filename: " . $filename .
" - size: " . $filesize . " - type: " . $filetype, Logger::DEBUG); " - size: " . $filesize . " - type: " . $filetype);
$imagedata = @file_get_contents($src); $imagedata = @file_get_contents($src);
$Image = new Image($imagedata, $filetype); $Image = new Image($imagedata, $filetype);
@ -183,7 +183,7 @@ function wall_upload_post(App $a, $desktopmode = true)
if ($max_length > 0) { if ($max_length > 0) {
$Image->scaleDown($max_length); $Image->scaleDown($max_length);
$filesize = strlen($Image->asString()); $filesize = strlen($Image->asString());
Logger::log("File upload: Scaling picture to new size " . $max_length, Logger::DEBUG); Logger::info("File upload: Scaling picture to new size " . $max_length);
} }
$width = $Image->getWidth(); $width = $Image->getWidth();
@ -278,11 +278,11 @@ function wall_upload_post(App $a, $desktopmode = true)
echo json_encode(['picture' => $picture]); echo json_encode(['picture' => $picture]);
exit(); exit();
} }
Logger::log("upload done", Logger::DEBUG); Logger::info("upload done");
return $picture; return $picture;
} }
Logger::log("upload done", Logger::DEBUG); Logger::info("upload done");
if ($r_json) { if ($r_json) {
echo json_encode(['ok' => true]); echo json_encode(['ok' => true]);

View File

@ -183,8 +183,8 @@ abstract class BaseModule
public static function checkFormSecurityTokenRedirectOnError($err_redirect, $typename = '', $formname = 'form_security_token') public static function checkFormSecurityTokenRedirectOnError($err_redirect, $typename = '', $formname = 'form_security_token')
{ {
if (!self::checkFormSecurityToken($typename, $formname)) { if (!self::checkFormSecurityToken($typename, $formname)) {
Logger::log('checkFormSecurityToken failed: user ' . DI::app()->getLoggedInUserNickname() . ' - form element ' . $typename); Logger::notice('checkFormSecurityToken failed: user ' . DI::app()->getLoggedInUserNickname() . ' - form element ' . $typename);
Logger::log('checkFormSecurityToken failed: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA); Logger::debug('checkFormSecurityToken failed', ['request' => $_REQUEST]);
notice(self::getFormSecurityStandardErrorMessage()); notice(self::getFormSecurityStandardErrorMessage());
DI::baseUrl()->redirect($err_redirect); DI::baseUrl()->redirect($err_redirect);
} }
@ -193,8 +193,8 @@ abstract class BaseModule
public static function checkFormSecurityTokenForbiddenOnError($typename = '', $formname = 'form_security_token') public static function checkFormSecurityTokenForbiddenOnError($typename = '', $formname = 'form_security_token')
{ {
if (!self::checkFormSecurityToken($typename, $formname)) { if (!self::checkFormSecurityToken($typename, $formname)) {
Logger::log('checkFormSecurityToken failed: user ' . DI::app()->getLoggedInUserNickname() . ' - form element ' . $typename); Logger::notice('checkFormSecurityToken failed: user ' . DI::app()->getLoggedInUserNickname() . ' - form element ' . $typename);
Logger::log('checkFormSecurityToken failed: _REQUEST data: ' . print_r($_REQUEST, true), Logger::DATA); Logger::debug('checkFormSecurityToken failed', ['request' => $_REQUEST]);
throw new \Friendica\Network\HTTPException\ForbiddenException(); throw new \Friendica\Network\HTTPException\ForbiddenException();
} }

View File

@ -2395,7 +2395,7 @@ class Contact
} }
if (($network != '') && ($ret['network'] != $network)) { if (($network != '') && ($ret['network'] != $network)) {
Logger::log('Expected network ' . $network . ' does not match actual network ' . $ret['network']); Logger::notice('Expected network ' . $network . ' does not match actual network ' . $ret['network']);
return $result; return $result;
} }
@ -2545,7 +2545,7 @@ class Contact
} }
} elseif ($protocol == Protocol::DIASPORA) { } elseif ($protocol == Protocol::DIASPORA) {
$ret = Diaspora::sendShare($owner, $contact); $ret = Diaspora::sendShare($owner, $contact);
Logger::log('share returns: ' . $ret); Logger::notice('share returns: ' . $ret);
} elseif ($protocol == Protocol::ACTIVITYPUB) { } elseif ($protocol == Protocol::ACTIVITYPUB) {
$activity_id = ActivityPub\Transmitter::activityIDFromContact($contact_id); $activity_id = ActivityPub\Transmitter::activityIDFromContact($contact_id);
if (empty($activity_id)) { if (empty($activity_id)) {
@ -2554,7 +2554,7 @@ class Contact
} }
$ret = ActivityPub\Transmitter::sendActivity('Follow', $contact['url'], $uid, $activity_id); $ret = ActivityPub\Transmitter::sendActivity('Follow', $contact['url'], $uid, $activity_id);
Logger::log('Follow returns: ' . $ret); Logger::notice('Follow returns: ' . $ret);
} }
} }
@ -2672,7 +2672,7 @@ class Contact
} else { } else {
// send email notification to owner? // send email notification to owner?
if (DBA::exists('contact', ['nurl' => Strings::normaliseLink($url), 'uid' => $importer['uid'], 'pending' => true])) { if (DBA::exists('contact', ['nurl' => Strings::normaliseLink($url), 'uid' => $importer['uid'], 'pending' => true])) {
Logger::log('ignoring duplicated connection request from pending contact ' . $url); Logger::notice('ignoring duplicated connection request from pending contact ' . $url);
return null; return null;
} }
@ -2791,7 +2791,7 @@ class Contact
$contacts = DBA::select('contact', ['id', 'uid', 'name', 'url', 'bd'], $condition); $contacts = DBA::select('contact', ['id', 'uid', 'name', 'url', 'bd'], $condition);
while ($contact = DBA::fetch($contacts)) { while ($contact = DBA::fetch($contacts)) {
Logger::log('update_contact_birthday: ' . $contact['bd']); Logger::notice('update_contact_birthday: ' . $contact['bd']);
$nextbd = DateTimeFormat::utcNow('Y') . substr($contact['bd'], 4); $nextbd = DateTimeFormat::utcNow('Y') . substr($contact['bd'], 4);

View File

@ -230,7 +230,7 @@ class Event
} }
DBA::delete('event', ['id' => $event_id]); DBA::delete('event', ['id' => $event_id]);
Logger::log("Deleted event ".$event_id, Logger::DEBUG); Logger::info("Deleted event", ['id' => $event_id]);
} }
/** /**

View File

@ -971,7 +971,7 @@ class Item
} }
if (!empty($item['cancel'])) { if (!empty($item['cancel'])) {
Logger::log('post cancelled by addon.'); Logger::notice('post cancelled by addon.');
return 0; return 0;
} }
@ -1885,7 +1885,7 @@ class Item
foreach ($matches as $mtch) { foreach ($matches as $mtch) {
if (Strings::compareLink($link, $mtch[1]) || Strings::compareLink($dlink, $mtch[1])) { if (Strings::compareLink($link, $mtch[1]) || Strings::compareLink($dlink, $mtch[1])) {
$mention = true; $mention = true;
Logger::log('mention found: ' . $mtch[2]); Logger::notice('mention found', ['mention' => $mtch[2]]);
} }
} }
} }
@ -2305,7 +2305,7 @@ class Item
++$expired; ++$expired;
} }
DBA::close($items); DBA::close($items);
Logger::log('User ' . $uid . ": expired $expired items; expire items: $expire_items, expire notes: $expire_notes, expire starred: $expire_starred, expire photos: $expire_photos"); Logger::notice('User ' . $uid . ": expired $expired items; expire items: $expire_items, expire notes: $expire_notes, expire starred: $expire_starred, expire photos: $expire_photos");
} }
public static function firstPostDate($uid, $wall = false) public static function firstPostDate($uid, $wall = false)
@ -2354,7 +2354,7 @@ class Item
$item = Post::selectFirst(self::ITEM_FIELDLIST, ['id' => $item_id]); $item = Post::selectFirst(self::ITEM_FIELDLIST, ['id' => $item_id]);
if (!DBA::isResult($item)) { if (!DBA::isResult($item)) {
Logger::log('like: unknown item ' . $item_id); Logger::notice('like: unknown item', ['id' => $item_id]);
return false; return false;
} }

View File

@ -187,7 +187,7 @@ class Mail
} }
if (!$convid) { if (!$convid) {
Logger::log('send message: conversation not found.'); Logger::notice('send message: conversation not found.');
return -4; return -4;
} }
@ -291,7 +291,7 @@ class Mail
} }
if (!$convid) { if (!$convid) {
Logger::log('send message: conversation not found.'); Logger::notice('send message: conversation not found.');
return -4; return -4;
} }

View File

@ -1517,7 +1517,7 @@ class User
return false; return false;
} }
Logger::log('Removing user: ' . $uid); Logger::notice('Removing user', ['user' => $uid]);
$user = DBA::selectFirst('user', [], ['uid' => $uid]); $user = DBA::selectFirst('user', [], ['uid' => $uid]);

View File

@ -57,7 +57,7 @@ class Attach extends BaseModule
$data = MAttach::getData($item); $data = MAttach::getData($item);
if (is_null($data)) { if (is_null($data)) {
Logger::log('NULL data for attachment with id ' . $item['id']); Logger::notice('NULL data for attachment with id ' . $item['id']);
throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Item was not found.')); throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Item was not found.'));
} }

View File

@ -82,7 +82,7 @@ class Register extends BaseModule
if ($max_dailies) { if ($max_dailies) {
$count = DBA::count('user', ['`register_date` > UTC_TIMESTAMP - INTERVAL 1 day']); $count = DBA::count('user', ['`register_date` > UTC_TIMESTAMP - INTERVAL 1 day']);
if ($count >= $max_dailies) { if ($count >= $max_dailies) {
Logger::log('max daily registrations exceeded.'); Logger::notice('max daily registrations exceeded.');
notice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.')); notice(DI::l10n()->t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.'));
return ''; return '';
} }

View File

@ -929,21 +929,21 @@ class DFRN
{ {
if (!$public_batch) { if (!$public_batch) {
if (empty($contact['addr'])) { if (empty($contact['addr'])) {
Logger::log('Empty contact handle for ' . $contact['id'] . ' - ' . $contact['url'] . ' - trying to update it.'); Logger::notice('Empty contact handle for ' . $contact['id'] . ' - ' . $contact['url'] . ' - trying to update it.');
if (Contact::updateFromProbe($contact['id'])) { if (Contact::updateFromProbe($contact['id'])) {
$new_contact = DBA::selectFirst('contact', ['addr'], ['id' => $contact['id']]); $new_contact = DBA::selectFirst('contact', ['addr'], ['id' => $contact['id']]);
$contact['addr'] = $new_contact['addr']; $contact['addr'] = $new_contact['addr'];
} }
if (empty($contact['addr'])) { if (empty($contact['addr'])) {
Logger::log('Unable to find contact handle for ' . $contact['id'] . ' - ' . $contact['url']); Logger::notice('Unable to find contact handle for ' . $contact['id'] . ' - ' . $contact['url']);
return -21; return -21;
} }
} }
$fcontact = FContact::getByURL($contact['addr']); $fcontact = FContact::getByURL($contact['addr']);
if (empty($fcontact)) { if (empty($fcontact)) {
Logger::log('Unable to find contact details for ' . $contact['id'] . ' - ' . $contact['addr']); Logger::notice('Unable to find contact details for ' . $contact['id'] . ' - ' . $contact['addr']);
return -22; return -22;
} }
$pubkey = $fcontact['pubkey']; $pubkey = $fcontact['pubkey'];
@ -976,7 +976,7 @@ class DFRN
$curl_stat = $postResult->getReturnCode(); $curl_stat = $postResult->getReturnCode();
if (empty($curl_stat) || empty($xml)) { if (empty($curl_stat) || empty($xml)) {
Logger::log('Empty answer from ' . $contact['id'] . ' - ' . $dest_url); Logger::notice('Empty answer from ' . $contact['id'] . ' - ' . $dest_url);
return -9; // timed out return -9; // timed out
} }
@ -985,8 +985,8 @@ class DFRN
} }
if (strpos($xml, '<?xml') === false) { if (strpos($xml, '<?xml') === false) {
Logger::log('No valid XML returned from ' . $contact['id'] . ' - ' . $dest_url); Logger::notice('No valid XML returned from ' . $contact['id'] . ' - ' . $dest_url);
Logger::log('Returned XML: ' . $xml, Logger::DATA); Logger::debug('Returned XML: ' . $xml);
return 3; return 3;
} }
@ -997,7 +997,7 @@ class DFRN
} }
if (!empty($res->message)) { if (!empty($res->message)) {
Logger::log('Transmit to ' . $dest_url . ' returned status '.$res->status.' - '.$res->message, Logger::DEBUG); Logger::info('Transmit to ' . $dest_url . ' returned status '.$res->status.' - '.$res->message);
} }
return intval($res->status); return intval($res->status);
@ -1088,12 +1088,12 @@ class DFRN
} }
if (empty($author['avatar'])) { if (empty($author['avatar'])) {
Logger::log('Empty author: ' . $xml); Logger::notice('Empty author: ' . $xml);
$author['avatar'] = ''; $author['avatar'] = '';
} }
if (DBA::isResult($contact_old) && !$onlyfetch) { if (DBA::isResult($contact_old) && !$onlyfetch) {
Logger::log("Check if contact details for contact " . $contact_old["id"] . " (" . $contact_old["nick"] . ") have to be updated.", Logger::DEBUG); Logger::info("Check if contact details for contact " . $contact_old["id"] . " (" . $contact_old["nick"] . ") have to be updated.");
$poco = ["url" => $contact_old["url"], "network" => $contact_old["network"]]; $poco = ["url" => $contact_old["url"], "network" => $contact_old["network"]];
@ -1154,7 +1154,7 @@ class DFRN
// If the "hide" element is present then the profile isn't searchable. // If the "hide" element is present then the profile isn't searchable.
$hide = intval(XML::getFirstNodeValue($xpath, $element . "/dfrn:hide/text()", $context) == "true"); $hide = intval(XML::getFirstNodeValue($xpath, $element . "/dfrn:hide/text()", $context) == "true");
Logger::log("Hidden status for contact " . $contact_old["url"] . ": " . $hide, Logger::DEBUG); Logger::info("Hidden status for contact " . $contact_old["url"] . ": " . $hide);
// If the contact isn't searchable then set the contact to "hidden". // If the contact isn't searchable then set the contact to "hidden".
// Problem: This can be manually overridden by the user. // Problem: This can be manually overridden by the user.
@ -1295,7 +1295,7 @@ class DFRN
*/ */
private static function processMail($xpath, $mail, $importer) private static function processMail($xpath, $mail, $importer)
{ {
Logger::log("Processing mails"); Logger::notice("Processing mails");
$msg = []; $msg = [];
$msg["uid"] = $importer["importer_uid"]; $msg["uid"] = $importer["importer_uid"];
@ -1397,7 +1397,7 @@ class DFRN
*/ */
private static function processRelocation($xpath, $relocation, $importer) private static function processRelocation($xpath, $relocation, $importer)
{ {
Logger::log("Processing relocations"); Logger::notice("Processing relocations");
/// @TODO Rewrite this to one statement /// @TODO Rewrite this to one statement
$relocate = []; $relocate = [];
@ -1444,7 +1444,7 @@ class DFRN
Contact::updateAvatar($importer["id"], $relocate["avatar"], true); Contact::updateAvatar($importer["id"], $relocate["avatar"], true);
Logger::log('Contacts are updated.'); Logger::notice('Contacts are updated.');
/// @TODO /// @TODO
/// merge with current record, current contents have priority /// merge with current record, current contents have priority
@ -1505,7 +1505,7 @@ class DFRN
if ($importer["page-flags"] == User::PAGE_FLAGS_COMMUNITY || $importer["page-flags"] == User::PAGE_FLAGS_PRVGROUP) { if ($importer["page-flags"] == User::PAGE_FLAGS_COMMUNITY || $importer["page-flags"] == User::PAGE_FLAGS_PRVGROUP) {
$sql_extra = ""; $sql_extra = "";
$community = true; $community = true;
Logger::log("possible community action"); Logger::notice("possible community action");
} else { } else {
$sql_extra = " AND `self` AND `wall`"; $sql_extra = " AND `self` AND `wall`";
} }
@ -1525,7 +1525,7 @@ class DFRN
*/ */
if ($is_a_remote_action && $community && (!$parent["forum_mode"]) && (!$parent["wall"])) { if ($is_a_remote_action && $community && (!$parent["forum_mode"]) && (!$parent["wall"])) {
$is_a_remote_action = false; $is_a_remote_action = false;
Logger::log("not a community action"); Logger::notice("not a community action");
} }
if ($is_a_remote_action) { if ($is_a_remote_action) {
@ -1606,7 +1606,7 @@ class DFRN
*/ */
private static function processVerbs($entrytype, $importer, &$item, &$is_like) private static function processVerbs($entrytype, $importer, &$item, &$is_like)
{ {
Logger::log("Process verb ".$item["verb"]." and object-type ".$item["object-type"]." for entrytype ".$entrytype, Logger::DEBUG); Logger::info("Process verb ".$item["verb"]." and object-type ".$item["object-type"]." for entrytype ".$entrytype);
if (($entrytype == DFRN::TOP_LEVEL) && !empty($importer['id'])) { if (($entrytype == DFRN::TOP_LEVEL) && !empty($importer['id'])) {
// The filling of the the "contact" variable is done for legcy reasons // The filling of the the "contact" variable is done for legcy reasons
@ -1618,22 +1618,22 @@ class DFRN
// Big question: Do we need these functions? They were part of the "consume_feed" function. // Big question: Do we need these functions? They were part of the "consume_feed" function.
// This function once was responsible for DFRN and OStatus. // This function once was responsible for DFRN and OStatus.
if ($activity->match($item["verb"], Activity::FOLLOW)) { if ($activity->match($item["verb"], Activity::FOLLOW)) {
Logger::log("New follower"); Logger::notice("New follower");
Contact::addRelationship($importer, $contact, $item); Contact::addRelationship($importer, $contact, $item);
return false; return false;
} }
if ($activity->match($item["verb"], Activity::UNFOLLOW)) { if ($activity->match($item["verb"], Activity::UNFOLLOW)) {
Logger::log("Lost follower"); Logger::notice("Lost follower");
Contact::removeFollower($contact); Contact::removeFollower($contact);
return false; return false;
} }
if ($activity->match($item["verb"], Activity::REQ_FRIEND)) { if ($activity->match($item["verb"], Activity::REQ_FRIEND)) {
Logger::log("New friend request"); Logger::notice("New friend request");
Contact::addRelationship($importer, $contact, $item, true); Contact::addRelationship($importer, $contact, $item, true);
return false; return false;
} }
if ($activity->match($item["verb"], Activity::UNFRIEND)) { if ($activity->match($item["verb"], Activity::UNFRIEND)) {
Logger::log("Lost sharer"); Logger::notice("Lost sharer");
Contact::removeSharer($importer, $contact, $item); Contact::removeSharer($importer, $contact, $item);
return false; return false;
} }
@ -1678,7 +1678,7 @@ class DFRN
$item_tag = Post::selectFirst(['id', 'uri-id'], ['uri' => $xt->id, 'uid' => $importer["importer_uid"]]); $item_tag = Post::selectFirst(['id', 'uri-id'], ['uri' => $xt->id, 'uid' => $importer["importer_uid"]]);
if (!DBA::isResult($item_tag)) { if (!DBA::isResult($item_tag)) {
Logger::log("Query failed to execute, no result returned in " . __FUNCTION__); Logger::notice("Query failed to execute, no result returned in " . __FUNCTION__);
return false; return false;
} }
@ -1765,7 +1765,7 @@ class DFRN
*/ */
private static function processEntry($header, $xpath, $entry, $importer, $xml, $protocol) private static function processEntry($header, $xpath, $entry, $importer, $xml, $protocol)
{ {
Logger::log("Processing entries"); Logger::notice("Processing entries");
$item = $header; $item = $header;
@ -1783,7 +1783,7 @@ class DFRN
); );
// Is there an existing item? // Is there an existing item?
if (DBA::isResult($current) && !self::isEditedTimestampNewer($current, $item)) { if (DBA::isResult($current) && !self::isEditedTimestampNewer($current, $item)) {
Logger::log("Item ".$item["uri"]." (".$item['edited'].") already existed.", Logger::DEBUG); Logger::info("Item ".$item["uri"]." (".$item['edited'].") already existed.");
return; return;
} }
@ -1993,10 +1993,10 @@ class DFRN
// Is it an event? // Is it an event?
if (($item["object-type"] == Activity\ObjectType::EVENT) && !$owner_unknown) { if (($item["object-type"] == Activity\ObjectType::EVENT) && !$owner_unknown) {
Logger::log("Item ".$item["uri"]." seems to contain an event.", Logger::DEBUG); Logger::info("Item ".$item["uri"]." seems to contain an event.");
$ev = Event::fromBBCode($item["body"]); $ev = Event::fromBBCode($item["body"]);
if ((!empty($ev['desc']) || !empty($ev['summary'])) && !empty($ev['start'])) { if ((!empty($ev['desc']) || !empty($ev['summary'])) && !empty($ev['start'])) {
Logger::log("Event in item ".$item["uri"]." was found.", Logger::DEBUG); Logger::info("Event in item ".$item["uri"]." was found.");
$ev["cid"] = $importer["id"]; $ev["cid"] = $importer["id"];
$ev["uid"] = $importer["importer_uid"]; $ev["uid"] = $importer["importer_uid"];
$ev["uri"] = $item["uri"]; $ev["uri"] = $item["uri"];
@ -2024,13 +2024,13 @@ class DFRN
} }
if (!self::processVerbs($entrytype, $importer, $item, $is_like)) { if (!self::processVerbs($entrytype, $importer, $item, $is_like)) {
Logger::log("Exiting because 'processVerbs' told us so", Logger::DEBUG); Logger::info("Exiting because 'processVerbs' told us so");
return; return;
} }
// This check is done here to be able to receive connection requests in "processVerbs" // This check is done here to be able to receive connection requests in "processVerbs"
if (($entrytype == DFRN::TOP_LEVEL) && $owner_unknown) { if (($entrytype == DFRN::TOP_LEVEL) && $owner_unknown) {
Logger::log("Item won't be stored because user " . $importer["importer_uid"] . " doesn't follow " . $item["owner-link"] . ".", Logger::DEBUG); Logger::info("Item won't be stored because user " . $importer["importer_uid"] . " doesn't follow " . $item["owner-link"] . ".");
return; return;
} }
@ -2038,9 +2038,9 @@ class DFRN
// Update content if 'updated' changes // Update content if 'updated' changes
if (DBA::isResult($current)) { if (DBA::isResult($current)) {
if (self::updateContent($current, $item, $importer, $entrytype)) { if (self::updateContent($current, $item, $importer, $entrytype)) {
Logger::log("Item ".$item["uri"]." was updated.", Logger::DEBUG); Logger::info("Item ".$item["uri"]." was updated.");
} else { } else {
Logger::log("Item " . $item["uri"] . " already existed.", Logger::DEBUG); Logger::info("Item " . $item["uri"] . " already existed.");
} }
return; return;
} }
@ -2053,7 +2053,7 @@ class DFRN
$posted_id = Item::insert($item); $posted_id = Item::insert($item);
if ($posted_id) { if ($posted_id) {
Logger::log("Reply from contact ".$item["contact-id"]." was stored with id ".$posted_id, Logger::DEBUG); Logger::info("Reply from contact ".$item["contact-id"]." was stored with id ".$posted_id);
if ($item['uid'] == 0) { if ($item['uid'] == 0) {
Item::distribute($posted_id); Item::distribute($posted_id);
@ -2063,7 +2063,7 @@ class DFRN
} }
} else { // $entrytype == DFRN::TOP_LEVEL } else { // $entrytype == DFRN::TOP_LEVEL
if (($importer["uid"] == 0) && ($importer["importer_uid"] != 0)) { if (($importer["uid"] == 0) && ($importer["importer_uid"] != 0)) {
Logger::log("Contact ".$importer["id"]." isn't known to user ".$importer["importer_uid"].". The post will be ignored.", Logger::DEBUG); Logger::info("Contact ".$importer["id"]." isn't known to user ".$importer["importer_uid"].". The post will be ignored.");
return; return;
} }
if (!Strings::compareLink($item["owner-link"], $importer["url"])) { if (!Strings::compareLink($item["owner-link"], $importer["url"])) {
@ -2073,13 +2073,13 @@ class DFRN
* the tgroup delivery code called from Item::insert will correct it if it's a forum, * the tgroup delivery code called from Item::insert will correct it if it's a forum,
* but we're going to unconditionally correct it here so that the post will always be owned by our contact. * but we're going to unconditionally correct it here so that the post will always be owned by our contact.
*/ */
Logger::log('Correcting item owner.', Logger::DEBUG); Logger::info('Correcting item owner.');
$item["owner-link"] = $importer["url"]; $item["owner-link"] = $importer["url"];
$item["owner-id"] = Contact::getIdForURL($importer["url"], 0); $item["owner-id"] = Contact::getIdForURL($importer["url"], 0);
} }
if (($importer["rel"] == Contact::FOLLOWER) && (!self::tgroupCheck($importer["importer_uid"], $item))) { if (($importer["rel"] == Contact::FOLLOWER) && (!self::tgroupCheck($importer["importer_uid"], $item))) {
Logger::log("Contact ".$importer["id"]." is only follower and tgroup check was negative.", Logger::DEBUG); Logger::info("Contact ".$importer["id"]." is only follower and tgroup check was negative.");
return; return;
} }
@ -2093,7 +2093,7 @@ class DFRN
$posted_id = $notify; $posted_id = $notify;
} }
Logger::log("Item was stored with id ".$posted_id, Logger::DEBUG); Logger::info("Item was stored with id ".$posted_id);
if ($item['uid'] == 0) { if ($item['uid'] == 0) {
Item::distribute($posted_id); Item::distribute($posted_id);
@ -2118,7 +2118,7 @@ class DFRN
*/ */
private static function processDeletion($xpath, $deletion, $importer) private static function processDeletion($xpath, $deletion, $importer)
{ {
Logger::log("Processing deletions"); Logger::notice("Processing deletions");
$uri = null; $uri = null;
foreach ($deletion->attributes as $attributes) { foreach ($deletion->attributes as $attributes) {
@ -2134,7 +2134,7 @@ class DFRN
$condition = ['uri' => $uri, 'uid' => $importer["importer_uid"]]; $condition = ['uri' => $uri, 'uid' => $importer["importer_uid"]];
$item = Post::selectFirst(['id', 'parent', 'contact-id', 'uri-id', 'deleted', 'gravity'], $condition); $item = Post::selectFirst(['id', 'parent', 'contact-id', 'uri-id', 'deleted', 'gravity'], $condition);
if (!DBA::isResult($item)) { if (!DBA::isResult($item)) {
Logger::log("Item with uri " . $uri . " for user " . $importer["importer_uid"] . " wasn't found.", Logger::DEBUG); Logger::info("Item with uri " . $uri . " for user " . $importer["importer_uid"] . " wasn't found.");
return; return;
} }
@ -2145,7 +2145,7 @@ class DFRN
// When it is a starting post it has to belong to the person that wants to delete it // When it is a starting post it has to belong to the person that wants to delete it
if (($item['gravity'] == GRAVITY_PARENT) && ($item['contact-id'] != $importer["id"])) { if (($item['gravity'] == GRAVITY_PARENT) && ($item['contact-id'] != $importer["id"])) {
Logger::log("Item with uri " . $uri . " don't belong to contact " . $importer["id"] . " - ignoring deletion.", Logger::DEBUG); Logger::info("Item with uri " . $uri . " don't belong to contact " . $importer["id"] . " - ignoring deletion.");
return; return;
} }
@ -2153,7 +2153,7 @@ class DFRN
if (($item['gravity'] != GRAVITY_PARENT) && ($item['contact-id'] != $importer["id"])) { if (($item['gravity'] != GRAVITY_PARENT) && ($item['contact-id'] != $importer["id"])) {
$condition = ['id' => $item['parent'], 'contact-id' => $importer["id"]]; $condition = ['id' => $item['parent'], 'contact-id' => $importer["id"]];
if (!Post::exists($condition)) { if (!Post::exists($condition)) {
Logger::log("Item with uri " . $uri . " wasn't found or mustn't be deleted by contact " . $importer["id"] . " - ignoring deletion.", Logger::DEBUG); Logger::info("Item with uri " . $uri . " wasn't found or mustn't be deleted by contact " . $importer["id"] . " - ignoring deletion.");
return; return;
} }
} }
@ -2162,7 +2162,7 @@ class DFRN
return; return;
} }
Logger::log('deleting item '.$item['id'].' uri='.$uri, Logger::DEBUG); Logger::info('deleting item '.$item['id'].' uri='.$uri);
Item::markForDeletion(['id' => $item['id']]); Item::markForDeletion(['id' => $item['id']]);
} }
@ -2224,7 +2224,7 @@ class DFRN
self::fetchauthor($xpath, $doc->firstChild, $importer, "dfrn:owner", false, $xml); self::fetchauthor($xpath, $doc->firstChild, $importer, "dfrn:owner", false, $xml);
} }
Logger::log("Import DFRN message for user " . $importer["importer_uid"] . " from contact " . $importer["id"], Logger::DEBUG); Logger::info("Import DFRN message for user " . $importer["importer_uid"] . " from contact " . $importer["id"]);
if (!empty($importer['gsid']) && ($protocol == Conversation::PARCEL_DIASPORA_DFRN)) { if (!empty($importer['gsid']) && ($protocol == Conversation::PARCEL_DIASPORA_DFRN)) {
GServer::setProtocol($importer['gsid'], Post\DeliveryData::DFRN); GServer::setProtocol($importer['gsid'], Post\DeliveryData::DFRN);
@ -2307,7 +2307,7 @@ class DFRN
self::processEntry($header, $xpath, $entry, $importer, $xml, $protocol); self::processEntry($header, $xpath, $entry, $importer, $xml, $protocol);
} }
Logger::log("Import done for user " . $importer["importer_uid"] . " from contact " . $importer["id"], Logger::DEBUG); Logger::info("Import done for user " . $importer["importer_uid"] . " from contact " . $importer["id"]);
return 200; return 200;
} }
@ -2357,7 +2357,7 @@ class DFRN
foreach ($matches as $mtch) { foreach ($matches as $mtch) {
if (Strings::compareLink($link, $mtch[1]) || Strings::compareLink($dlink, $mtch[1])) { if (Strings::compareLink($link, $mtch[1]) || Strings::compareLink($dlink, $mtch[1])) {
$mention = true; $mention = true;
Logger::log('mention found: ' . $mtch[2]); Logger::notice('mention found: ' . $mtch[2]);
} }
} }
} }

View File

@ -212,7 +212,7 @@ class OStatus
Contact::update($contact, ['id' => $contact["id"]], $current); Contact::update($contact, ['id' => $contact["id"]], $current);
if (!empty($author["author-avatar"]) && ($author["author-avatar"] != $current['avatar'])) { if (!empty($author["author-avatar"]) && ($author["author-avatar"] != $current['avatar'])) {
Logger::log("Update profile picture for contact ".$contact["id"], Logger::DEBUG); Logger::info("Update profile picture for contact ".$contact["id"]);
Contact::updateAvatar($contact["id"], $author["author-avatar"]); Contact::updateAvatar($contact["id"], $author["author-avatar"]);
} }
@ -336,7 +336,7 @@ class OStatus
self::$conv_list = []; self::$conv_list = [];
} }
Logger::log('Import OStatus message for user ' . $importer['uid'], Logger::DEBUG); Logger::info('Import OStatus message for user ' . $importer['uid']);
if ($xml == "") { if ($xml == "") {
return false; return false;
@ -362,7 +362,7 @@ class OStatus
foreach ($hub_attributes as $hub_attribute) { foreach ($hub_attributes as $hub_attribute) {
if ($hub_attribute->name == "href") { if ($hub_attribute->name == "href") {
$hub = $hub_attribute->textContent; $hub = $hub_attribute->textContent;
Logger::log("Found hub ".$hub, Logger::DEBUG); Logger::info("Found hub ".$hub);
} }
} }
} }
@ -440,27 +440,27 @@ class OStatus
if (in_array($item["verb"], [Activity::O_UNFAVOURITE, Activity::UNFAVORITE])) { if (in_array($item["verb"], [Activity::O_UNFAVOURITE, Activity::UNFAVORITE])) {
// Ignore "Unfavorite" message // Ignore "Unfavorite" message
Logger::log("Ignore unfavorite message ".print_r($item, true), Logger::DEBUG); Logger::info("Ignore unfavorite message ", ['item' => $item]);
continue; continue;
} }
// Deletions come with the same uri, so we check for duplicates after processing deletions // Deletions come with the same uri, so we check for duplicates after processing deletions
if (Post::exists(['uid' => $importer["uid"], 'uri' => $item["uri"]])) { if (Post::exists(['uid' => $importer["uid"], 'uri' => $item["uri"]])) {
Logger::log('Post with URI '.$item["uri"].' already existed for user '.$importer["uid"].'.', Logger::DEBUG); Logger::info('Post with URI '.$item["uri"].' already existed for user '.$importer["uid"].'.');
continue; continue;
} else { } else {
Logger::log('Processing post with URI '.$item["uri"].' for user '.$importer["uid"].'.', Logger::DEBUG); Logger::info('Processing post with URI '.$item["uri"].' for user '.$importer["uid"].'.');
} }
if ($item["verb"] == Activity::JOIN) { if ($item["verb"] == Activity::JOIN) {
// ignore "Join" messages // ignore "Join" messages
Logger::log("Ignore join message ".print_r($item, true), Logger::DEBUG); Logger::info("Ignore join message ", ['item' => $item]);
continue; continue;
} }
if ($item["verb"] == "http://mastodon.social/schema/1.0/block") { if ($item["verb"] == "http://mastodon.social/schema/1.0/block") {
// ignore mastodon "block" messages // ignore mastodon "block" messages
Logger::log("Ignore block message ".print_r($item, true), Logger::DEBUG); Logger::info("Ignore block message ", ['item' => $item]);
continue; continue;
} }
@ -477,7 +477,7 @@ class OStatus
if ($item["verb"] == Activity::FAVORITE) { if ($item["verb"] == Activity::FAVORITE) {
$orig_uri = $xpath->query("activity:object/atom:id", $entry)->item(0)->nodeValue; $orig_uri = $xpath->query("activity:object/atom:id", $entry)->item(0)->nodeValue;
Logger::log("Favorite ".$orig_uri." ".print_r($item, true)); Logger::notice("Favorite", ['uri' => $orig_uri, 'item' => $item]);
$item["verb"] = Activity::LIKE; $item["verb"] = Activity::LIKE;
$item["thr-parent"] = $orig_uri; $item["thr-parent"] = $orig_uri;
@ -487,7 +487,7 @@ class OStatus
// http://activitystrea.ms/schema/1.0/rsvp-yes // http://activitystrea.ms/schema/1.0/rsvp-yes
if (!in_array($item["verb"], [Activity::POST, Activity::LIKE, Activity::SHARE])) { if (!in_array($item["verb"], [Activity::POST, Activity::LIKE, Activity::SHARE])) {
Logger::log("Unhandled verb ".$item["verb"]." ".print_r($item, true), Logger::DEBUG); Logger::info("Unhandled verb", ['verb' => $item["verb"], 'item' => $item]);
} }
self::processPost($xpath, $entry, $item, $importer); self::processPost($xpath, $entry, $item, $importer);
@ -501,10 +501,10 @@ class OStatus
// If not, then it depends on this setting // If not, then it depends on this setting
$valid = ((self::$itemlist[0]['uid'] == 0) || !DI::pConfig()->get(self::$itemlist[0]['uid'], 'system', 'accept_only_sharer', false)); $valid = ((self::$itemlist[0]['uid'] == 0) || !DI::pConfig()->get(self::$itemlist[0]['uid'], 'system', 'accept_only_sharer', false));
if ($valid) { if ($valid) {
Logger::log("Item with uri ".self::$itemlist[0]['uri']." will be imported due to the system settings.", Logger::DEBUG); Logger::info("Item with uri ".self::$itemlist[0]['uri']." will be imported due to the system settings.");
} }
} else { } else {
Logger::log("Item with uri ".self::$itemlist[0]['uri']." belongs to a contact (".self::$itemlist[0]['contact-id']."). It will be imported.", Logger::DEBUG); Logger::info("Item with uri ".self::$itemlist[0]['uri']." belongs to a contact (".self::$itemlist[0]['contact-id']."). It will be imported.");
} }
if ($valid) { if ($valid) {
// Never post a thread when the only interaction by our contact was a like // Never post a thread when the only interaction by our contact was a like
@ -516,7 +516,7 @@ class OStatus
} }
} }
if ($valid) { if ($valid) {
Logger::log("Item with uri ".self::$itemlist[0]['uri']." will be imported since the thread contains posts or shares.", Logger::DEBUG); Logger::info("Item with uri ".self::$itemlist[0]['uri']." will be imported since the thread contains posts or shares.");
} }
} }
} else { } else {
@ -535,18 +535,18 @@ class OStatus
foreach (self::$itemlist as $item) { foreach (self::$itemlist as $item) {
$found = Post::exists(['uid' => $importer["uid"], 'uri' => $item["uri"]]); $found = Post::exists(['uid' => $importer["uid"], 'uri' => $item["uri"]]);
if ($found) { if ($found) {
Logger::log("Item with uri ".$item["uri"]." for user ".$importer["uid"]." already exists.", Logger::DEBUG); Logger::info("Item with uri ".$item["uri"]." for user ".$importer["uid"]." already exists.");
} elseif ($item['contact-id'] < 0) { } elseif ($item['contact-id'] < 0) {
Logger::log("Item with uri ".$item["uri"]." is from a blocked contact.", Logger::DEBUG); Logger::info("Item with uri ".$item["uri"]." is from a blocked contact.");
} else { } else {
$ret = Item::insert($item); $ret = Item::insert($item);
Logger::log("Item with uri ".$item["uri"]." for user ".$importer["uid"].' stored. Return value: '.$ret); Logger::notice("Item with uri ".$item["uri"]." for user ".$importer["uid"].' stored. Return value: '.$ret);
} }
} }
} }
self::$itemlist = []; self::$itemlist = [];
} }
Logger::log('Processing done for post with URI '.$item["uri"].' for user '.$importer["uid"].'.', Logger::DEBUG); Logger::info('Processing done for post with URI '.$item["uri"].' for user '.$importer["uid"].'.');
} }
return true; return true;
} }
@ -562,13 +562,13 @@ class OStatus
{ {
$condition = ['uid' => $item['uid'], 'author-id' => $item['author-id'], 'uri' => $item['uri']]; $condition = ['uid' => $item['uid'], 'author-id' => $item['author-id'], 'uri' => $item['uri']];
if (!Post::exists($condition)) { if (!Post::exists($condition)) {
Logger::log('Item from '.$item['author-link'].' with uri '.$item['uri'].' for user '.$item['uid']." wasn't found. We don't delete it."); Logger::notice('Item from '.$item['author-link'].' with uri '.$item['uri'].' for user '.$item['uid']." wasn't found. We don't delete it.");
return; return;
} }
Item::markForDeletion($condition); Item::markForDeletion($condition);
Logger::log('Deleted item with uri '.$item['uri'].' for user '.$item['uid']); Logger::notice('Deleted item with uri '.$item['uri'].' for user '.$item['uid']);
} }
/** /**
@ -697,7 +697,7 @@ class OStatus
self::fetchRelated($related, $item["thr-parent"], $importer); self::fetchRelated($related, $item["thr-parent"], $importer);
} }
} else { } else {
Logger::log('Reply with URI '.$item["uri"].' already existed for user '.$importer["uid"].'.', Logger::DEBUG); Logger::info('Reply with URI '.$item["uri"].' already existed for user '.$importer["uid"].'.');
} }
} else { } else {
$item["thr-parent"] = $item["uri"]; $item["thr-parent"] = $item["uri"];
@ -845,7 +845,7 @@ class OStatus
$conv_data['source'] = $doc2->saveXML(); $conv_data['source'] = $doc2->saveXML();
Logger::log('Store conversation data for uri '.$conv_data['uri'], Logger::DEBUG); Logger::info('Store conversation data for uri '.$conv_data['uri']);
Conversation::insert($conv_data); Conversation::insert($conv_data);
} }
} }
@ -868,7 +868,7 @@ class OStatus
Conversation::PARCEL_DIASPORA_DFRN, Conversation::PARCEL_LEGACY_DFRN, Conversation::PARCEL_DIASPORA_DFRN, Conversation::PARCEL_LEGACY_DFRN,
Conversation::PARCEL_LOCAL_DFRN, Conversation::PARCEL_DIRECT, Conversation::PARCEL_SALMON]]; Conversation::PARCEL_LOCAL_DFRN, Conversation::PARCEL_DIRECT, Conversation::PARCEL_SALMON]];
if (DBA::exists('conversation', $condition)) { if (DBA::exists('conversation', $condition)) {
Logger::log('Conversation '.$item['uri'].' is already stored.', Logger::DEBUG); Logger::info('Conversation '.$item['uri'].' is already stored.');
return; return;
} }
@ -889,7 +889,7 @@ class OStatus
$item["source"] = $xml; $item["source"] = $xml;
$item["direction"] = Conversation::PULL; $item["direction"] = Conversation::PULL;
Logger::log('Conversation '.$item['uri'].' is now fetched.', Logger::DEBUG); Logger::info('Conversation '.$item['uri'].' is now fetched.');
} }
/** /**
@ -912,11 +912,11 @@ class OStatus
$stored = true; $stored = true;
$xml = $conversation['source']; $xml = $conversation['source'];
if (self::process($xml, $importer, $contact, $hub, $stored, false, Conversation::PULL)) { if (self::process($xml, $importer, $contact, $hub, $stored, false, Conversation::PULL)) {
Logger::log('Got valid cached XML for URI '.$related_uri, Logger::DEBUG); Logger::info('Got valid cached XML for URI '.$related_uri);
return; return;
} }
if ($conversation['protocol'] == Conversation::PARCEL_SALMON) { if ($conversation['protocol'] == Conversation::PARCEL_SALMON) {
Logger::log('Delete invalid cached XML for URI '.$related_uri, Logger::DEBUG); Logger::info('Delete invalid cached XML for URI '.$related_uri);
DBA::delete('conversation', ['item-uri' => $related_uri]); DBA::delete('conversation', ['item-uri' => $related_uri]);
} }
} }
@ -932,7 +932,7 @@ class OStatus
if ($curlResult->inHeader('Content-Type') && if ($curlResult->inHeader('Content-Type') &&
in_array('application/atom+xml', $curlResult->getHeader('Content-Type'))) { in_array('application/atom+xml', $curlResult->getHeader('Content-Type'))) {
Logger::log('Directly fetched XML for URI ' . $related_uri, Logger::DEBUG); Logger::info('Directly fetched XML for URI ' . $related_uri);
$xml = $curlResult->getBody(); $xml = $curlResult->getBody();
} }
@ -957,7 +957,7 @@ class OStatus
$curlResult = DI::httpClient()->get($atom_file); $curlResult = DI::httpClient()->get($atom_file);
if ($curlResult->isSuccess()) { if ($curlResult->isSuccess()) {
Logger::log('Fetched XML for URI ' . $related_uri, Logger::DEBUG); Logger::info('Fetched XML for URI ' . $related_uri);
$xml = $curlResult->getBody(); $xml = $curlResult->getBody();
} }
} }
@ -969,7 +969,7 @@ class OStatus
$curlResult = DI::httpClient()->get(str_replace('/notice/', '/api/statuses/show/', $related) . '.atom'); $curlResult = DI::httpClient()->get(str_replace('/notice/', '/api/statuses/show/', $related) . '.atom');
if ($curlResult->isSuccess()) { if ($curlResult->isSuccess()) {
Logger::log('GNU Social workaround to fetch XML for URI ' . $related_uri, Logger::DEBUG); Logger::info('GNU Social workaround to fetch XML for URI ' . $related_uri);
$xml = $curlResult->getBody(); $xml = $curlResult->getBody();
} }
} }
@ -980,7 +980,7 @@ class OStatus
$curlResult = DI::httpClient()->get(str_replace('/notice/', '/api/statuses/show/', $related_guess) . '.atom'); $curlResult = DI::httpClient()->get(str_replace('/notice/', '/api/statuses/show/', $related_guess) . '.atom');
if ($curlResult->isSuccess()) { if ($curlResult->isSuccess()) {
Logger::log('GNU Social workaround 2 to fetch XML for URI ' . $related_uri, Logger::DEBUG); Logger::info('GNU Social workaround 2 to fetch XML for URI ' . $related_uri);
$xml = $curlResult->getBody(); $xml = $curlResult->getBody();
} }
} }
@ -991,7 +991,7 @@ class OStatus
$conversation = DBA::selectFirst('conversation', ['source'], $condition); $conversation = DBA::selectFirst('conversation', ['source'], $condition);
if (DBA::isResult($conversation)) { if (DBA::isResult($conversation)) {
$stored = true; $stored = true;
Logger::log('Got cached XML from conversation for URI '.$related_uri, Logger::DEBUG); Logger::info('Got cached XML from conversation for URI '.$related_uri);
$xml = $conversation['source']; $xml = $conversation['source'];
} }
} }
@ -999,7 +999,7 @@ class OStatus
if ($xml != '') { if ($xml != '') {
self::process($xml, $importer, $contact, $hub, $stored, false, Conversation::PULL); self::process($xml, $importer, $contact, $hub, $stored, false, Conversation::PULL);
} else { } else {
Logger::log("XML couldn't be fetched for URI: ".$related_uri." - href: ".$related, Logger::DEBUG); Logger::info("XML couldn't be fetched for URI: ".$related_uri." - href: ".$related);
} }
return; return;
} }
@ -1536,7 +1536,7 @@ class OStatus
private static function likeEntry(DOMDocument $doc, array $item, array $owner, $toplevel) private static function likeEntry(DOMDocument $doc, array $item, array $owner, $toplevel)
{ {
if (($item['gravity'] != GRAVITY_PARENT) && (Strings::normaliseLink($item["author-link"]) != Strings::normaliseLink($owner["url"]))) { if (($item['gravity'] != GRAVITY_PARENT) && (Strings::normaliseLink($item["author-link"]) != Strings::normaliseLink($owner["url"]))) {
Logger::log("OStatus entry is from author ".$owner["url"]." - not from ".$item["author-link"].". Quitting.", Logger::DEBUG); Logger::info("OStatus entry is from author ".$owner["url"]." - not from ".$item["author-link"].". Quitting.");
} }
$entry = self::entryHeader($doc, $owner, $item, $toplevel); $entry = self::entryHeader($doc, $owner, $item, $toplevel);
@ -1685,7 +1685,7 @@ class OStatus
private static function noteEntry(DOMDocument $doc, array $item, array $owner, $toplevel) private static function noteEntry(DOMDocument $doc, array $item, array $owner, $toplevel)
{ {
if (($item['gravity'] != GRAVITY_PARENT) && (Strings::normaliseLink($item["author-link"]) != Strings::normaliseLink($owner["url"]))) { if (($item['gravity'] != GRAVITY_PARENT) && (Strings::normaliseLink($item["author-link"]) != Strings::normaliseLink($owner["url"]))) {
Logger::log("OStatus entry is from author ".$owner["url"]." - not from ".$item["author-link"].". Quitting.", Logger::DEBUG); Logger::info("OStatus entry is from author ".$owner["url"]." - not from ".$item["author-link"].". Quitting.");
} }
if (!$toplevel) { if (!$toplevel) {
@ -1983,7 +1983,7 @@ class OStatus
if ((time() - strtotime($owner['last-item'])) < 15*60) { if ((time() - strtotime($owner['last-item'])) < 15*60) {
$result = DI::cache()->get($cachekey); $result = DI::cache()->get($cachekey);
if (!$nocache && !is_null($result)) { if (!$nocache && !is_null($result)) {
Logger::log('Feed duration: ' . number_format(microtime(true) - $stamp, 3) . ' - ' . $owner_nick . ' - ' . $filter . ' - ' . $previous_created . ' (cached)', Logger::DEBUG); Logger::info('Feed duration: ' . number_format(microtime(true) - $stamp, 3) . ' - ' . $owner_nick . ' - ' . $filter . ' - ' . $previous_created . ' (cached)');
$last_update = $result['last_update']; $last_update = $result['last_update'];
return $result['feed']; return $result['feed'];
} }
@ -2048,7 +2048,7 @@ class OStatus
$msg = ['feed' => $feeddata, 'last_update' => $last_update]; $msg = ['feed' => $feeddata, 'last_update' => $last_update];
DI::cache()->set($cachekey, $msg, Duration::QUARTER_HOUR); DI::cache()->set($cachekey, $msg, Duration::QUARTER_HOUR);
Logger::log('Feed duration: ' . number_format(microtime(true) - $stamp, 3) . ' - ' . $owner_nick . ' - ' . $filter . ' - ' . $previous_created, Logger::DEBUG); Logger::info('Feed duration: ' . number_format(microtime(true) - $stamp, 3) . ' - ' . $owner_nick . ' - ' . $filter . ' - ' . $previous_created);
return $feeddata; return $feeddata;
} }

View File

@ -46,7 +46,7 @@ class Salmon
{ {
$ret = []; $ret = [];
Logger::log('Fetching salmon key for '.$uri); Logger::notice('Fetching salmon key for '.$uri);
$arr = Probe::lrdd($uri); $arr = Probe::lrdd($uri);
@ -116,12 +116,12 @@ class Salmon
} }
if (!$owner['sprvkey']) { if (!$owner['sprvkey']) {
Logger::log(sprintf("user '%s' (%d) does not have a salmon private key. Send failed.", Logger::notice(sprintf("user '%s' (%d) does not have a salmon private key. Send failed.",
$owner['name'], $owner['uid'])); $owner['name'], $owner['uid']));
return; return;
} }
Logger::log('slapper called for '.$url.'. Data: ' . $slap); Logger::notice('slapper called for '.$url.'. Data: ' . $slap);
// create a magic envelope // create a magic envelope
@ -165,7 +165,7 @@ class Salmon
// check for success, e.g. 2xx // check for success, e.g. 2xx
if ($return_code > 299) { if ($return_code > 299) {
Logger::log('GNU Social salmon failed. Falling back to compliant mode'); Logger::notice('GNU Social salmon failed. Falling back to compliant mode');
// Now try the compliant mode that normally isn't used for GNU Social // Now try the compliant mode that normally isn't used for GNU Social
$xmldata = ["me:env" => ["me:data" => $data, $xmldata = ["me:env" => ["me:data" => $data,
@ -188,7 +188,7 @@ class Salmon
} }
if ($return_code > 299) { if ($return_code > 299) {
Logger::log('compliant salmon failed. Falling back to old status.net'); Logger::notice('compliant salmon failed. Falling back to old status.net');
// Last try. This will most likely fail as well. // Last try. This will most likely fail as well.
$xmldata = ["me:env" => ["me:data" => $data, $xmldata = ["me:env" => ["me:data" => $data,
@ -209,7 +209,7 @@ class Salmon
$return_code = $postResult->getReturnCode(); $return_code = $postResult->getReturnCode();
} }
Logger::log('slapper for '.$url.' returned ' . $return_code); Logger::notice('slapper for '.$url.' returned ' . $return_code);
if (! $return_code) { if (! $return_code) {
return -1; return -1;

View File

@ -136,7 +136,7 @@ class Crypto
$result = openssl_pkey_new($openssl_options); $result = openssl_pkey_new($openssl_options);
if (empty($result)) { if (empty($result)) {
Logger::log('new_keypair: failed'); Logger::notice('new_keypair: failed');
return false; return false;
} }
@ -261,7 +261,7 @@ class Crypto
private static function encapsulateOther($data, $pubkey, $alg) private static function encapsulateOther($data, $pubkey, $alg)
{ {
if (!$pubkey) { if (!$pubkey) {
Logger::log('no key. data: '.$data); Logger::notice('no key. data: '.$data);
} }
$fn = 'encrypt' . strtoupper($alg); $fn = 'encrypt' . strtoupper($alg);
if (method_exists(__CLASS__, $fn)) { if (method_exists(__CLASS__, $fn)) {
@ -303,7 +303,7 @@ class Crypto
private static function encapsulateAes($data, $pubkey) private static function encapsulateAes($data, $pubkey)
{ {
if (!$pubkey) { if (!$pubkey) {
Logger::log('aes_encapsulate: no key. data: ' . $data); Logger::notice('aes_encapsulate: no key. data: ' . $data);
} }
$key = random_bytes(32); $key = random_bytes(32);
@ -314,7 +314,7 @@ class Crypto
// log the offending call so we can track it down // log the offending call so we can track it down
if (!openssl_public_encrypt($key, $k, $pubkey)) { if (!openssl_public_encrypt($key, $k, $pubkey)) {
$x = debug_backtrace(); $x = debug_backtrace();
Logger::log('aes_encapsulate: RSA failed. ' . print_r($x[0], true)); Logger::notice('aes_encapsulate: RSA failed.', ['data' => $x[0]]);
} }
$result['alg'] = 'aes256cbc'; $result['alg'] = 'aes256cbc';

View File

@ -157,7 +157,7 @@ class DateTimeFormat
try { try {
$d = new DateTime($s, $from_obj); $d = new DateTime($s, $from_obj);
} catch (Exception $e) { } catch (Exception $e) {
Logger::log('DateTimeFormat::convert: exception: ' . $e->getMessage()); Logger::notice('DateTimeFormat::convert: exception: ' . $e->getMessage());
$d = new DateTime('now', $from_obj); $d = new DateTime('now', $from_obj);
} }

View File

@ -80,7 +80,7 @@ class HTTPSignature
$sig_block = self::parseSigheader($headers['authorization']); $sig_block = self::parseSigheader($headers['authorization']);
if (!$sig_block) { if (!$sig_block) {
Logger::log('no signature provided.'); Logger::notice('no signature provided.');
return $result; return $result;
} }
@ -110,7 +110,7 @@ class HTTPSignature
$key = $key($sig_block['keyId']); $key = $key($sig_block['keyId']);
} }
Logger::log('Got keyID ' . $sig_block['keyId'], Logger::DEBUG); Logger::info('Got keyID ' . $sig_block['keyId']);
if (!$key) { if (!$key) {
return $result; return $result;
@ -118,7 +118,7 @@ class HTTPSignature
$x = Crypto::rsaVerify($signed_data, $sig_block['signature'], $key, $algorithm); $x = Crypto::rsaVerify($signed_data, $sig_block['signature'], $key, $algorithm);
Logger::log('verified: ' . $x, Logger::DEBUG); Logger::info('verified: ' . $x);
if (!$x) { if (!$x) {
return $result; return $result;
@ -308,7 +308,7 @@ class HTTPSignature
$postResult = DI::httpClient()->post($target, $content, $headers); $postResult = DI::httpClient()->post($target, $content, $headers);
$return_code = $postResult->getReturnCode(); $return_code = $postResult->getReturnCode();
Logger::log('Transmit to ' . $target . ' returned ' . $return_code, Logger::DEBUG); Logger::info('Transmit to ' . $target . ' returned ' . $return_code);
$success = ($return_code >= 200) && ($return_code <= 299); $success = ($return_code >= 200) && ($return_code <= 299);
@ -459,7 +459,7 @@ class HTTPSignature
} }
$return_code = $curlResult->getReturnCode(); $return_code = $curlResult->getReturnCode();
Logger::log('Fetched for user ' . $uid . ' from ' . $request . ' returned ' . $return_code, Logger::DEBUG); Logger::info('Fetched for user ' . $uid . ' from ' . $request . ' returned ' . $return_code);
return $curlResult; return $curlResult;
} }
@ -604,7 +604,7 @@ class HTTPSignature
if (in_array('date', $sig_block['headers'])) { if (in_array('date', $sig_block['headers'])) {
$diff = abs(strtotime($headers['date']) - time()); $diff = abs(strtotime($headers['date']) - time());
if ($diff > 300) { if ($diff > 300) {
Logger::log("Header date '" . $headers['date'] . "' is with " . $diff . " seconds out of the 300 second frame. The signature is invalid."); Logger::notice("Header date '" . $headers['date'] . "' is with " . $diff . " seconds out of the 300 second frame. The signature is invalid.");
return false; return false;
} }
$hasGoodSignedContent = true; $hasGoodSignedContent = true;

View File

@ -268,7 +268,7 @@ class Network
$avatar['url'] = DI::baseUrl() . Contact::DEFAULT_AVATAR_PHOTO; $avatar['url'] = DI::baseUrl() . Contact::DEFAULT_AVATAR_PHOTO;
} }
Logger::log('Avatar: ' . $avatar['email'] . ' ' . $avatar['url'], Logger::DEBUG); Logger::info('Avatar: ' . $avatar['email'] . ' ' . $avatar['url']);
return $avatar['url']; return $avatar['url'];
} }

View File

@ -284,7 +284,7 @@ class Strings
public static function base64UrlDecode($s) public static function base64UrlDecode($s)
{ {
if (is_array($s)) { if (is_array($s)) {
Logger::log('base64url_decode: illegal input: ' . print_r(debug_backtrace(), true)); Logger::notice('base64url_decode: illegal input: ', ['backtrace' => debug_backtrace()]);
return $s; return $s;
} }

View File

@ -268,7 +268,7 @@ class XML
} }
if (!function_exists('xml_parser_create')) { if (!function_exists('xml_parser_create')) {
Logger::log('Xml::toArray: parser function missing'); Logger::notice('Xml::toArray: parser function missing');
return []; return [];
} }
@ -283,7 +283,7 @@ class XML
} }
if (! $parser) { if (! $parser) {
Logger::log('Xml::toArray: xml_parser_create: no resource'); Logger::notice('Xml::toArray: xml_parser_create: no resource');
return []; return [];
} }
@ -295,9 +295,9 @@ class XML
@xml_parser_free($parser); @xml_parser_free($parser);
if (! $xml_values) { if (! $xml_values) {
Logger::log('Xml::toArray: libxml: parse error: ' . $contents, Logger::DATA); Logger::debug('Xml::toArray: libxml: parse error: ' . $contents);
foreach (libxml_get_errors() as $err) { foreach (libxml_get_errors() as $err) {
Logger::log('libxml: parse: ' . $err->code . " at " . $err->line . ":" . $err->column . " : " . $err->message, Logger::DATA); Logger::debug('libxml: parse: ' . $err->code . " at " . $err->line . ":" . $err->column . " : " . $err->message);
} }
libxml_clear_errors(); libxml_clear_errors();
return; return;

View File

@ -35,7 +35,7 @@ class CheckVersion
{ {
public static function execute() public static function execute()
{ {
Logger::log('checkversion: start'); Logger::notice('checkversion: start');
$checkurl = DI::config()->get('system', 'check_new_version_url', 'none'); $checkurl = DI::config()->get('system', 'check_new_version_url', 'none');
@ -51,15 +51,15 @@ class CheckVersion
// don't check // don't check
return; return;
} }
Logger::log("Checking VERSION from: ".$checked_url, Logger::DEBUG); Logger::info("Checking VERSION from: ".$checked_url);
// fetch the VERSION file // fetch the VERSION file
$gitversion = DBA::escape(trim(DI::httpClient()->fetch($checked_url))); $gitversion = DBA::escape(trim(DI::httpClient()->fetch($checked_url)));
Logger::log("Upstream VERSION is: ".$gitversion, Logger::DEBUG); Logger::notice("Upstream VERSION is: ".$gitversion);
DI::config()->set('system', 'git_friendica_version', $gitversion); DI::config()->set('system', 'git_friendica_version', $gitversion);
Logger::log('checkversion: end'); Logger::notice('checkversion: end');
return; return;
} }

View File

@ -51,7 +51,7 @@ class Directory
Hook::callAll('globaldir_update', $arr); Hook::callAll('globaldir_update', $arr);
Logger::log('Updating directory: ' . $arr['url'], Logger::DEBUG); Logger::info('Updating directory: ' . $arr['url']);
if (strlen($arr['url'])) { if (strlen($arr['url'])) {
DI::httpClient()->fetch($dir . '?url=' . bin2hex($arr['url'])); DI::httpClient()->fetch($dir . '?url=' . bin2hex($arr['url']));
} }

View File

@ -41,7 +41,7 @@ class ProfileUpdate {
$inboxes = ActivityPub\Transmitter::fetchTargetInboxesforUser($uid); $inboxes = ActivityPub\Transmitter::fetchTargetInboxesforUser($uid);
foreach ($inboxes as $inbox => $receivers) { foreach ($inboxes as $inbox => $receivers) {
Logger::log('Profile update for user ' . $uid . ' to ' . $inbox .' via ActivityPub', Logger::DEBUG); Logger::info('Profile update for user ' . $uid . ' to ' . $inbox .' via ActivityPub');
Worker::add(['priority' => $a->getQueueValue('priority'), 'created' => $a->getQueueValue('created'), 'dont_fork' => true], Worker::add(['priority' => $a->getQueueValue('priority'), 'created' => $a->getQueueValue('created'), 'dont_fork' => true],
'APDelivery', Delivery::PROFILEUPDATE, 0, $inbox, $uid, $receivers); 'APDelivery', Delivery::PROFILEUPDATE, 0, $inbox, $uid, $receivers);
} }

View File

@ -48,7 +48,7 @@ class PubSubPublish
/// @todo Check server status with GServer::check() /// @todo Check server status with GServer::check()
// Before this can be done we need a way to safely detect the server url. // Before this can be done we need a way to safely detect the server url.
Logger::log("Generate feed of user " . $subscriber['nickname']. " to " . $subscriber['callback_url']. " - last updated " . $subscriber['last_update'], Logger::DEBUG); Logger::info("Generate feed of user " . $subscriber['nickname']. " to " . $subscriber['callback_url']. " - last updated " . $subscriber['last_update']);
$last_update = $subscriber['last_update']; $last_update = $subscriber['last_update'];
$params = OStatus::feed($subscriber['nickname'], $last_update); $params = OStatus::feed($subscriber['nickname'], $last_update);
@ -66,17 +66,17 @@ class PubSubPublish
$subscriber['topic']), $subscriber['topic']),
'X-Hub-Signature' => 'sha1=' . $hmac_sig]; 'X-Hub-Signature' => 'sha1=' . $hmac_sig];
Logger::log('POST ' . print_r($headers, true) . "\n" . $params, Logger::DATA); Logger::debug('POST ' . ['headers' => $headers, 'params' => $params]);
$postResult = DI::httpClient()->post($subscriber['callback_url'], $params, $headers); $postResult = DI::httpClient()->post($subscriber['callback_url'], $params, $headers);
$ret = $postResult->getReturnCode(); $ret = $postResult->getReturnCode();
if ($ret >= 200 && $ret <= 299) { if ($ret >= 200 && $ret <= 299) {
Logger::log('Successfully pushed to ' . $subscriber['callback_url']); Logger::notice('Successfully pushed to ' . $subscriber['callback_url']);
PushSubscriber::reset($subscriber['id'], $last_update); PushSubscriber::reset($subscriber['id'], $last_update);
} else { } else {
Logger::log('Delivery error when pushing to ' . $subscriber['callback_url'] . ' HTTP: ' . $ret); Logger::notice('Delivery error when pushing to ' . $subscriber['callback_url'] . ' HTTP: ' . $ret);
PushSubscriber::delay($subscriber['id']); PushSubscriber::delay($subscriber['id']);
} }

View File

@ -57,7 +57,7 @@ function frio_install()
Hook::register('nav_info', 'view/theme/frio/theme.php', 'frio_remote_nav'); Hook::register('nav_info', 'view/theme/frio/theme.php', 'frio_remote_nav');
Hook::register('display_item', 'view/theme/frio/theme.php', 'frio_display_item'); Hook::register('display_item', 'view/theme/frio/theme.php', 'frio_display_item');
Logger::log('installed theme frio'); Logger::notice('installed theme frio');
} }
/** /**

View File

@ -49,7 +49,7 @@ foreach (['style', $style] as $file) {
} }
} else { } else {
//TODO: use Logger::ERROR? //TODO: use Logger::ERROR?
Logger::log('Error: missing file: "' . $stylecssfile .'" (userid: '. $uid .')'); Logger::notice('Error: missing file: "' . $stylecssfile .'" (userid: '. $uid .')');
} }
} }
$modified = gmdate('r', $modified); $modified = gmdate('r', $modified);