Lines Matching refs:level
285 * @param int $level The logging level
292 public function addRecord(int $level, string $message, array $context = []): bool argument
299 if (!$handler->isHandling(['level' => $level])) {
303 $levelName = static::getLevelName($level);
308 'level' => $level,
402 public static function getLevelName(int $level): string argument
404 if (!isset(static::$levels[$level])) {
405 …throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ',…
408 return static::$levels[$level];
414 * @param string|int $level Level number (monolog) or name (PSR-3)
420 public static function toMonologLevel($level): int argument
422 if (is_string($level)) {
423 if (is_numeric($level)) {
425 return intval($level);
430 $upper = strtr($level, 'abcdefgilmnortuwy', 'ABCDEFGILMNORTUWY');
435 …throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ',…
438 if (!is_int($level)) {
439 …throw new InvalidArgumentException('Level "'.var_export($level, true).'" is not defined, use one o…
442 return $level;
450 public function isHandling(int $level): bool argument
453 'level' => $level,
487 * @param mixed $level The log level
493 public function log($level, $message, array $context = []): void argument
495 if (!is_int($level) && !is_string($level)) {
499 $level = static::toMonologLevel($level);
501 $this->addRecord($level, (string) $message, $context);