feat: add logging info

This commit is contained in:
Maël Gangloff
2024-08-04 14:45:27 +02:00
parent 9d7076a76b
commit e413bfedc0
6 changed files with 93 additions and 8 deletions

View File

@@ -22,6 +22,7 @@ use Eluceo\iCal\Domain\ValueObject\Timestamp;
use Eluceo\iCal\Presentation\Component\Property;
use Eluceo\iCal\Presentation\Component\Property\Value\TextValue;
use Eluceo\iCal\Presentation\Factory\CalendarFactory;
use Psr\Log\LoggerInterface;
use Sabre\VObject\EofException;
use Sabre\VObject\InvalidDataException;
use Sabre\VObject\ParseException;
@@ -37,7 +38,8 @@ class WatchListController extends AbstractController
public function __construct(
private readonly SerializerInterface $serializer,
private readonly EntityManagerInterface $em,
private readonly WatchListRepository $watchListRepository
private readonly WatchListRepository $watchListRepository,
private readonly LoggerInterface $logger
) {
}
@@ -60,6 +62,10 @@ class WatchListController extends AbstractController
$user = $this->getUser();
$watchList->setUser($user);
$this->logger->info('User {username} register a Watchlist.', [
'username' => $user->getUserIdentifier(),
]);
$this->em->persist($watchList);
$this->em->flush();