mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-24 14:23:41 +00:00
[twitter] Improve logging for actions
This commit is contained in:
parent
1e451a3490
commit
9d2c8902d3
1 changed files with 7 additions and 6 deletions
|
@ -491,24 +491,25 @@ function twitter_action(App $a, $uid, $pid, $action)
|
||||||
|
|
||||||
$post = ['id' => $pid];
|
$post = ['id' => $pid];
|
||||||
|
|
||||||
Logger::log("twitter_action '" . $action . "' ID: " . $pid . " data: " . print_r($post, true), Logger::DATA);
|
Logger::debug('before action', ['action' => $action, 'pid' => $pid, 'data' => $post]);
|
||||||
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case "delete":
|
case 'delete':
|
||||||
// To-Do: $result = $connection->post('statuses/destroy', $post);
|
// To-Do: $result = $connection->post('statuses/destroy', $post);
|
||||||
$result = [];
|
$result = [];
|
||||||
break;
|
break;
|
||||||
case "like":
|
case 'like':
|
||||||
$result = $connection->post('favorites/create', $post);
|
$result = $connection->post('favorites/create', $post);
|
||||||
break;
|
break;
|
||||||
case "unlike":
|
case 'unlike':
|
||||||
$result = $connection->post('favorites/destroy', $post);
|
$result = $connection->post('favorites/destroy', $post);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Logger::log('Unhandled action ' . $action, Logger::DEBUG);
|
Logger::warning('Unhandled action', ['action' => $action]);
|
||||||
$result = [];
|
$result = [];
|
||||||
}
|
}
|
||||||
Logger::log("twitter_action '" . $action . "' send, result: " . print_r($result, true), Logger::DEBUG);
|
|
||||||
|
Logger::info('after action', ['action' => $action, 'result' => $result]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function twitter_post_hook(App $a, array &$b)
|
function twitter_post_hook(App $a, array &$b)
|
||||||
|
|
Loading…
Reference in a new issue