Merge pull request #1131 from annando/twitter-logging

Twitter: Improved logging for the picture upload
pull/1134/head
Hypolite Petovan 2021-06-02 09:31:30 -04:00 committed by GitHub
commit b300d27d19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -716,10 +716,10 @@ function twitter_post_hook(App $a, array &$b)
$data = ['media_id' => $media->media_id_string, $data = ['media_id' => $media->media_id_string,
'alt_text' => ['text' => substr($image['description'], 0, 420)]]; 'alt_text' => ['text' => substr($image['description'], 0, 420)]];
$ret = $cb->media_metadata_create($data); $ret = $cb->media_metadata_create($data);
Logger::info('Metadata create', ['id' => $b['id'], 'data' => $data, 'return' => json_encode($ret)]); Logger::info('Metadata create', ['id' => $b['id'], 'data' => $data, 'return' => $ret]);
} }
} else { } else {
Logger::error('Failed upload', ['id' => $b['id'], 'image' => $image['url']]); Logger::error('Failed upload', ['id' => $b['id'], 'image' => $image['url'], 'return' => $media]);
throw new Exception('Failed upload of ' . $image['url']); throw new Exception('Failed upload of ' . $image['url']);
} }
} }