Some better log msgs

This commit is contained in:
Zach Copley 2010-01-06 07:44:34 +00:00
parent fd33865258
commit c95114ea02
2 changed files with 15 additions and 7 deletions

View File

@ -4,7 +4,8 @@ http://SITE/PATH/api/statuses/user_timeline/USERNAME.rss). When the
plugin is enabled, StatusNet acts as both the publisher and hub ('writer' and plugin is enabled, StatusNet acts as both the publisher and hub ('writer' and
'cloud' in RSSCloud parlance), but only for local StatusNet feeds. It's 'cloud' in RSSCloud parlance), but only for local StatusNet feeds. It's
not possible to use it as a general purpose hub -- for instance you can't not possible to use it as a general purpose hub -- for instance you can't
subscribe and get updates to a Wordpress feed from StatusNet. subscribe and get updates to a Wordpress feed from StatusNet using this
plugin.
To use the plugin, add the following to your config.php: To use the plugin, add the following to your config.php:
@ -33,7 +34,7 @@ Notes
----- -----
- Again, only RSS 2.0 profile feeds may be subscribed to, and they have - Again, only RSS 2.0 profile feeds may be subscribed to, and they have
be the ones with user names in them, like: to be the ones with user names in them, like:
http://SITE/PATH/api/statuses/user_timeline/USERNAME.rss http://SITE/PATH/api/statuses/user_timeline/USERNAME.rss
- Subscriptions are deleted after three notification failures in a row - Subscriptions are deleted after three notification failures in a row
(not sure this is optimal). (not sure this is optimal).

View File

@ -137,6 +137,11 @@ class RSSCloudRequestNotifyAction extends Action
foreach ($this->feeds as $feed) { foreach ($this->feeds as $feed) {
if (!$this->validateFeed($feed)) { if (!$this->validateFeed($feed)) {
$nh = $this->getNotifyUrl();
common_log(LOG_WARNING,
"RSSCloud plugin - $nh tried to subscribe to invalid feed: $feed");
$msg = 'Feed subscription failed - Not a valid feed.'; $msg = 'Feed subscription failed - Not a valid feed.';
$this->showResult(false, $msg); $this->showResult(false, $msg);
return; return;
@ -216,8 +221,6 @@ class RSSCloudRequestNotifyAction extends Action
function testNotificationHandler($feed) function testNotificationHandler($feed)
{ {
common_debug("RSSCloudPlugin - testNotificationHandler()");
$notifyUrl = $this->getNotifyUrl(); $notifyUrl = $this->getNotifyUrl();
$notifier = new RSSCloudNotifier(); $notifier = new RSSCloudNotifier();
@ -226,12 +229,13 @@ class RSSCloudRequestNotifyAction extends Action
// 'domain' param set, so we have to use GET and send a challenge // 'domain' param set, so we have to use GET and send a challenge
common_log(LOG_INFO, 'Testing notification handler with challenge: ' . common_log(LOG_INFO,
'RSSCloud plugin - Testing notification handler with challenge: ' .
$notifyUrl); $notifyUrl);
return $notifier->challenge($notifyUrl, $feed); return $notifier->challenge($notifyUrl, $feed);
} else { } else {
common_log(LOG_INFO, 'Testing notification handler: ' . common_log(LOG_INFO, 'RSSCloud plugin - Testing notification handler: ' .
$notifyUrl); $notifyUrl);
return $notifier->postUpdate($notifyUrl, $feed); return $notifier->postUpdate($notifyUrl, $feed);
@ -298,7 +302,8 @@ class RSSCloudRequestNotifyAction extends Action
$sub = RSSCloudSubscription::getSubscription($user->id, $notifyUrl); $sub = RSSCloudSubscription::getSubscription($user->id, $notifyUrl);
if ($sub) { if ($sub) {
common_debug("Already subscribed to that!"); common_log(LOG_INFO, "RSSCloud plugin - $notifyUrl refreshed subscription" .
" to user $user->nickname (id: $user->id).");
} else { } else {
$sub = new RSSCloudSubscription(); $sub = new RSSCloudSubscription();
@ -312,6 +317,8 @@ class RSSCloudRequestNotifyAction extends Action
return false; return false;
} }
common_log(LOG_INFO, "RSSCloud plugin - $notifyUrl subscribed" .
" to user $user->nickname (id: $user->id)");
} }
return true; return true;