Skip to content

Commit

Permalink
Include logger functionality
Browse files Browse the repository at this point in the history
#2: Used `LoggerAwareTrait` to add logging capability. Initialized with `NullLogger`.
  • Loading branch information
hochleitner committed Dec 17, 2021
1 parent b577811 commit cf71d79
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Closure;
use Fhooe\Router\Exception\HandlerNotSetException;
use InvalidArgumentException;
use Psr\Log\LoggerAwareTrait;
use Psr\Log\NullLogger;

/**
* A simple object-oriented Router for educational purposes.
Expand All @@ -21,6 +23,8 @@
*/
class Router
{
use LoggerAwareTrait;

/**
* @var array<string> The supported HTTP methods for this router.
*/
Expand Down Expand Up @@ -51,6 +55,7 @@ public function __construct()
{
$this->routes = [];
$this->noRouteCallback = null;
$this->logger = new NullLogger();
}

/**
Expand Down

0 comments on commit cf71d79

Please sign in to comment.