PHP Classes

File: src/Logging/LoggingLevel.php

Recommend this page to a friend!
  Classes of Mohamed Ahmed   Laravel MCP SDK   src/Logging/LoggingLevel.php   Download  
File: src/Logging/LoggingLevel.php
Role: Example script
Content typex: text/plain
Description: Example script
Class: Laravel MCP SDK
Create tools to process user requests with prompts
Author: By
Last change:
Date: Yesterday
Size: 814 bytes
 

Contents

Class file image Download
<?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}"),
        };
    }
}