<?php
namespace LaravelMCP\MCP\Logging;
enum LoggingLevel: string
{
case DEBUG = 'debug';
case INFO = 'info';
case NOTICE = 'notice';
case WARNING = 'warning';
case ERROR = 'error';
case CRITICAL = 'critical';
case ALERT = 'alert';
case EMERGENCY = 'emergency';
public static function fromString(string $level): self
{
return match ($level) {
'debug' => self::DEBUG,
'info' => self::INFO,
'notice' => self::NOTICE,
'warning' => self::WARNING,
'error' => self::ERROR,
'critical' => self::CRITICAL,
'alert' => self::ALERT,
'emergency' => self::EMERGENCY,
default => throw new \InvalidArgumentException("Invalid logging level: {$level}"),
};
}
}
|