Add logging

This commit is contained in:
Björn Fromme
2021-06-08 17:44:33 +02:00
parent b4e7179e8d
commit 244cbd7002
@@ -211,6 +211,7 @@ class GroupsSwissService implements SingletonInterface, LoggerAwareInterface
*/ */
protected function addItem(array $item, $status, $apiKey, $houseNumber): void protected function addItem(array $item, $status, $apiKey, $houseNumber): void
{ {
$this->logger->info(sprintf('Adding status %d in %s-%s for %s', $status, $item['from']->format('Y-m-d'), $item['to']->format('Y-m-d'), $houseNumber));
$url = sprintf( $url = sprintf(
'http://www.groups.swiss/api/1.0/json.php?apiKey=%s&method=setAvailabilityChart&house=%d&from=%s&till=%s&state=%d', 'http://www.groups.swiss/api/1.0/json.php?apiKey=%s&method=setAvailabilityChart&house=%d&from=%s&till=%s&state=%d',
$apiKey, $apiKey,
@@ -221,8 +222,7 @@ class GroupsSwissService implements SingletonInterface, LoggerAwareInterface
); );
try { try {
$foo = 1; $this->httpClient->request('GET', $url);
// $this->httpClient->request('GET', $url);
} catch (TransportExceptionInterface $e) { } catch (TransportExceptionInterface $e) {
$this->logger->error(sprintf('A problem occured: %s', $e->getMessage())); $this->logger->error(sprintf('A problem occured: %s', $e->getMessage()));
} }