for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Spiral\Logger;
use Psr\Log\LoggerInterface;
use Psr\Log\LoggerTrait;
/**
* Simply forwards debug messages into various locations.
*/
final class NullLogger implements LoggerInterface
{
use LoggerTrait;
private readonly \Closure $receptor;
public function __construct(
callable $receptor,
private string $channel
) {
$this->receptor = $receptor(...);
receptor
Spiral\Logger\NullLogger
}
public function log(mixed $level, $message, array $context = []): void
\call_user_func($this->receptor, $this->channel, $level, $message, $context);