Skip to content

Commit b6d405d

Browse files
committed
adding a bit more logging
1 parent d4ebad7 commit b6d405d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

app/config/services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ services:
3232

3333
app.github.request_handler:
3434
class: AppBundle\Issues\GitHubRequestHandler
35-
arguments: ['@event_dispatcher', '@app.repository_provider', '@service_container']
35+
arguments: ['@event_dispatcher', '@app.repository_provider', '@service_container', '@logger']
3636

3737
app.repository_provider:
3838
class: AppBundle\Repository\Provider\InMemoryRepositoryProvider

src/AppBundle/Issues/GitHubRequestHandler.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use AppBundle\Event\GitHubEvent;
66
use AppBundle\Repository\Provider\RepositoryProviderInterface;
7+
use Psr\Log\LoggerInterface;
78
use Symfony\Component\DependencyInjection\ContainerInterface;
89
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
910
use Symfony\Component\HttpFoundation\Request;
@@ -21,12 +22,14 @@ class GitHubRequestHandler
2122
private $dispatcher;
2223
private $repositoryProvider;
2324
private $container;
25+
private $logger;
2426

25-
public function __construct(EventDispatcherInterface $dispatcher, RepositoryProviderInterface $repositoryProvider, ContainerInterface $container)
27+
public function __construct(EventDispatcherInterface $dispatcher, RepositoryProviderInterface $repositoryProvider, ContainerInterface $container, LoggerInterface $logger)
2628
{
2729
$this->dispatcher = $dispatcher;
2830
$this->repositoryProvider = $repositoryProvider;
2931
$this->container = $container;
32+
$this->logger = $logger;
3033
}
3134

3235
/**
@@ -46,6 +49,8 @@ public function handle(Request $request)
4649
throw new BadRequestHttpException('No repository name!');
4750
}
4851

52+
$this->logger->debug(sprintf('Handling from repository %s', $repositoryFullName));
53+
4954
$repository = $this->repositoryProvider->getRepository($repositoryFullName);
5055

5156
if (!$repository) {

0 commit comments

Comments
 (0)