ameliabooking
/
vendor
/
wordpress
/
php-mcp-schema
/
src
/
Server
/
Logging
/
Enum
/
LoggingLevel.php
ameliabooking
/
vendor
/
wordpress
/
php-mcp-schema
/
src
/
Server
/
Logging
/
Enum
Last commit date
LoggingLevel.php
1 month ago
LoggingLevel.php
89 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace WP\McpSchema\Server\Logging\Enum; |
| 6 | |
| 7 | use WP\McpSchema\Common\AbstractEnum; |
| 8 | |
| 9 | /** |
| 10 | * The severity of a log message. |
| 11 | * |
| 12 | * These map to syslog message severities, as specified in RFC-5424: |
| 13 | * https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1 |
| 14 | * |
| 15 | * @mcp-domain Server |
| 16 | * @mcp-subdomain Logging |
| 17 | * @mcp-version 2025-11-25 |
| 18 | */ |
| 19 | final class LoggingLevel extends AbstractEnum |
| 20 | { |
| 21 | public const DEBUG = 'debug'; |
| 22 | public const INFO = 'info'; |
| 23 | public const NOTICE = 'notice'; |
| 24 | public const WARNING = 'warning'; |
| 25 | public const ERROR = 'error'; |
| 26 | public const CRITICAL = 'critical'; |
| 27 | public const ALERT = 'alert'; |
| 28 | public const EMERGENCY = 'emergency'; |
| 29 | |
| 30 | public static function debug(): self |
| 31 | { |
| 32 | return self::from('debug'); |
| 33 | } |
| 34 | |
| 35 | public static function info(): self |
| 36 | { |
| 37 | return self::from('info'); |
| 38 | } |
| 39 | |
| 40 | public static function notice(): self |
| 41 | { |
| 42 | return self::from('notice'); |
| 43 | } |
| 44 | |
| 45 | public static function warning(): self |
| 46 | { |
| 47 | return self::from('warning'); |
| 48 | } |
| 49 | |
| 50 | public static function error(): self |
| 51 | { |
| 52 | return self::from('error'); |
| 53 | } |
| 54 | |
| 55 | public static function critical(): self |
| 56 | { |
| 57 | return self::from('critical'); |
| 58 | } |
| 59 | |
| 60 | public static function alert(): self |
| 61 | { |
| 62 | return self::from('alert'); |
| 63 | } |
| 64 | |
| 65 | public static function emergency(): self |
| 66 | { |
| 67 | return self::from('emergency'); |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Returns all valid values for this enum. |
| 72 | * |
| 73 | * @return string[] |
| 74 | */ |
| 75 | public static function values(): array |
| 76 | { |
| 77 | return [ |
| 78 | self::DEBUG, |
| 79 | self::INFO, |
| 80 | self::NOTICE, |
| 81 | self::WARNING, |
| 82 | self::ERROR, |
| 83 | self::CRITICAL, |
| 84 | self::ALERT, |
| 85 | self::EMERGENCY, |
| 86 | ]; |
| 87 | } |
| 88 | } |
| 89 |