[5.0][MonologBridge] Fix $level type

This commit is contained in:
Thomas Calvet 2020-04-03 16:59:55 +02:00
parent e1a522b470
commit d9c06814f9
2 changed files with 9 additions and 3 deletions

View File

@ -26,11 +26,14 @@ class NotifierHandler extends AbstractHandler
{
private $notifier;
public function __construct(NotifierInterface $notifier, int $level = Logger::ERROR, bool $bubble = true)
/**
* @param string|int $level The minimum logging level at which this handler will be triggered
*/
public function __construct(NotifierInterface $notifier, $level = Logger::ERROR, bool $bubble = true)
{
$this->notifier = $notifier;
parent::__construct($level < Logger::ERROR ? Logger::ERROR : $level, $bubble);
parent::__construct(Logger::toMonologLevel($level) < Logger::ERROR ? Logger::ERROR : $level, $bubble);
}
public function handle(array $record): bool

View File

@ -54,7 +54,10 @@ trait ServerLogHandlerTrait
private $context;
private $socket;
public function __construct(string $host, int $level = Logger::DEBUG, bool $bubble = true, array $context = [])
/**
* @param string|int $level The minimum logging level at which this handler will be triggered
*/
public function __construct(string $host, $level = Logger::DEBUG, bool $bubble = true, array $context = [])
{
parent::__construct($level, $bubble);