Skip to content

Commit

Permalink
Better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
unreal4u committed Feb 2, 2016
1 parent ef81da2 commit 4917684
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/TgLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ protected function sendRequestToTelegram(TelegramMethods $method, array $formDat
{
$this->logger->debug('About to instantiate HTTP Client');
$client = new Client();
$this->logger->info('About to perform POST to Telegram bot API');
$response = $client->post($this->composeApiMethodUrl($method), $formData);
$this->logger->debug('Got response back from Telegram, applying json_decode');
return json_decode((string)$response->getBody(), true);
Expand Down Expand Up @@ -209,7 +208,7 @@ protected function composeApiMethodUrl(TelegramMethods $call): string
{
$completeClassName = get_class($call);
$this->methodName = substr($completeClassName, strrpos($completeClassName, '\\') + 1);
$this->logger->debug(sprintf('Selected API method is %s', $this->methodName));
$this->logger->info('About to perform API request', ['method' => $this->methodName]);

return $this->apiUrl . $this->methodName;
}
Expand Down

0 comments on commit 4917684

Please sign in to comment.