Make logger nullable in Transport constructors (#152)
- BaseTransport: Accept ?LoggerInterface parameter and convert null to NullLogger - StdioTransport: Change logger parameter to nullable - StreamableHttpTransport: Change logger parameter to nullable - InMemoryTransport: Fix missing parent::__construct() call and add logging
This commit is contained in:
parent
7cd281d0c7
commit
470237ad0b
1 changed files with 14 additions and 7 deletions
|
|
@ -18,7 +18,6 @@ use Psr\Http\Message\ResponseInterface;
|
|||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Message\StreamFactoryInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Psr\Log\NullLogger;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
|
||||
/**
|
||||
|
|
@ -45,7 +44,7 @@ class StreamableHttpTransport extends BaseTransport implements TransportInterfac
|
|||
?ResponseFactoryInterface $responseFactory = null,
|
||||
?StreamFactoryInterface $streamFactory = null,
|
||||
array $corsHeaders = [],
|
||||
LoggerInterface $logger = new NullLogger(),
|
||||
?LoggerInterface $logger = null,
|
||||
) {
|
||||
parent::__construct($logger);
|
||||
$sessionIdString = $this->request->getHeaderLine('Mcp-Session-Id');
|
||||
|
|
|
|||
Loading…
Reference in a new issue