Debugging output in OStatus for easier reading+greping

This commit is contained in:
Mikael Nordfeldth 2016-03-23 17:52:02 +01:00
parent e32f2b0a39
commit 2759c3f0db
2 changed files with 6 additions and 6 deletions

View File

@ -132,11 +132,11 @@ class OStatusPlugin extends Plugin
if ($notice->inScope(null) && $notice->getProfile()->hasRight(Right::PUBLICNOTICE)) { if ($notice->inScope(null) && $notice->getProfile()->hasRight(Right::PUBLICNOTICE)) {
// put our transport first, in case there's any conflict (like OMB) // put our transport first, in case there's any conflict (like OMB)
array_unshift($transports, 'ostatus'); array_unshift($transports, 'ostatus');
$this->log(LOG_INFO, "Notice {$notice->id} queued for OStatus processing"); $this->log(LOG_INFO, "OSTATUS [{$notice->getID()}]: queued for OStatus processing");
} else { } else {
// FIXME: we don't do privacy-controlled OStatus updates yet. // FIXME: we don't do privacy-controlled OStatus updates yet.
// once that happens, finer grain of control here. // once that happens, finer grain of control here.
$this->log(LOG_NOTICE, "Not queueing notice {$notice->id} for OStatus because of privacy; scope = {$notice->scope}"); $this->log(LOG_NOTICE, "OSTATUS [{$notice->getID()}]: Not queueing because of privacy; scope = {$notice->scope}");
} }
return true; return true;
} }

View File

@ -194,17 +194,17 @@ class OStatusQueueHandler extends QueueHandler
// and then upgrade it. This self-healing feature needs to be enabled manually in config. // and then upgrade it. This self-healing feature needs to be enabled manually in config.
// This code is based on a patch by @hannes2peer@quitter.se // This code is based on a patch by @hannes2peer@quitter.se
if (common_config('fix', 'legacy_http') && parse_url($feed, PHP_URL_SCHEME) === 'https') { if (common_config('fix', 'legacy_http') && parse_url($feed, PHP_URL_SCHEME) === 'https') {
common_log(LOG_DEBUG, 'OSTATUS: Searching for http scheme instead for HubSub feed topic: '._ve($feed)); common_log(LOG_DEBUG, "OSTATUS [{$this->notice->getID()}]: Searching for http scheme instead for HubSub feed topic: "._ve($feed));
$http_feed = str_replace('https://', 'http://', $feed); $http_feed = str_replace('https://', 'http://', $feed);
$sub = new HubSub(); $sub = new HubSub();
$sub->topic = $http_feed; $sub->topic = $http_feed;
// If we find it we upgrade the rows in the hubsub table. // If we find it we upgrade the rows in the hubsub table.
if ($sub->find()) { if ($sub->find()) {
common_log(LOG_INFO, 'OSTATUS: Found topic with http scheme for '._ve($feed).', will update the rows to use https instead!'); common_log(LOG_INFO, "OSTATUS [{$this->notice->getID()}]: Found topic with http scheme for "._ve($feed).", will update the rows to use https instead!");
// we found an http:// URL but we use https:// now // we found an http:// URL but we use https:// now
// so let's update the rows to reflect on this! // so let's update the rows to reflect on this!
while ($sub->fetch()) { while ($sub->fetch()) {
common_debug('OSTATUS: Changing topic URL to https for feed callback '._ve($sub->callback)); common_debug("OSTATUS [{$this->notice->getID()}]: Changing topic URL to https for feed callback "._ve($sub->callback));
$orig = clone($sub); $orig = clone($sub);
$sub->topic = $feed; $sub->topic = $feed;
// hashkey column will be set automagically in HubSub->onUpdateKeys through updateWithKeys // hashkey column will be set automagically in HubSub->onUpdateKeys through updateWithKeys
@ -221,7 +221,7 @@ class OStatusQueueHandler extends QueueHandler
$atom = call_user_func_array($callback, $args); $atom = call_user_func_array($callback, $args);
$this->pushFeedInternal($atom, $sub); $this->pushFeedInternal($atom, $sub);
} else { } else {
common_log(LOG_INFO, "No PuSH subscribers for $feed"); common_log(LOG_INFO, "OSTATUS [{$this->notice->getID()}]: No PuSH subscribers for $feed");
} }
} }