File "ErrorLevelActivationStrategy.php"
Full Path: /home/jlklyejr/public_html/post-date/wp-content/plugins/flexible-shipping/vendor_prefixed/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php
File size: 1.15 KB
MIME-type: text/x-php
Charset: utf-8
<?php
declare (strict_types=1);
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FSVendor\Monolog\Handler\FingersCrossed;
use FSVendor\Monolog\Logger;
use Psr\Log\LogLevel;
/**
* Error level based activation strategy.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*
* @phpstan-import-type Level from \Monolog\Logger
* @phpstan-import-type LevelName from \Monolog\Logger
*/
class ErrorLevelActivationStrategy implements \FSVendor\Monolog\Handler\FingersCrossed\ActivationStrategyInterface
{
/**
* @var Level
*/
private $actionLevel;
/**
* @param int|string $actionLevel Level or name or value
*
* @phpstan-param Level|LevelName|LogLevel::* $actionLevel
*/
public function __construct($actionLevel)
{
$this->actionLevel = \FSVendor\Monolog\Logger::toMonologLevel($actionLevel);
}
public function isHandlerActivated(array $record) : bool
{
return $record['level'] >= $this->actionLevel;
}
}