GOOD SHELL MAS BOY
Server: Apache/2.4.52 (Ubuntu)
System: Linux vmi1836763.contaboserver.net 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64
User: www-data (33)
PHP: 8.4.10
Disabled: NONE
Upload Files
File: /var/www/html/vendor/sentry/sentry/src/Logs/LogLevel.php
<?php

declare(strict_types=1);

namespace Sentry\Logs;

/**
 * @see: https://develop.sentry.dev/sdk/telemetry/logs/#log-severity-level
 */
class LogLevel
{
    /**
     * @var string The value of the enum instance
     */
    private $value;

    /**
     * @var array<string, self> A list of cached enum instances
     */
    private static $instances = [];

    private function __construct(string $value)
    {
        $this->value = $value;
    }

    public static function trace(): self
    {
        return self::getInstance('trace');
    }

    public static function debug(): self
    {
        return self::getInstance('debug');
    }

    public static function info(): self
    {
        return self::getInstance('info');
    }

    public static function warn(): self
    {
        return self::getInstance('warn');
    }

    public static function error(): self
    {
        return self::getInstance('error');
    }

    public static function fatal(): self
    {
        return self::getInstance('fatal');
    }

    public function __toString(): string
    {
        return $this->value;
    }

    private static function getInstance(string $value): self
    {
        if (!isset(self::$instances[$value])) {
            self::$instances[$value] = new self($value);
        }

        return self::$instances[$value];
    }
}