public static function factory(string $className = ''): LogInterface
    {
        static::init();

        $className = '\\'.$className;
        $loggerConfig = \array_key_exists($className, static::$classConfig)
            ? static::$classConfig[$className]
            : static::$classConfig['Default'];
        $loggerClass = '\\MS\\LightFramework\\Log\\Backend\\'.\ucfirst($loggerConfig['backend']);
        $logDestination = $loggerConfig['destination'];
        $logLevel = 0;

        if ($loggerConfig['logDebug'] === true) {
            $logLevel |= static::LOG_DEBUG;
        }
        if ($loggerConfig['logInfo'] === true) {
            $logLevel |= static::LOG_INFO;
        }
        if ($loggerConfig['logWarning'] === true) {
            $logLevel |= static::LOG_WARNING;
        }
        if ($loggerConfig['logError'] === true) {
            $logLevel |= static::LOG_ERROR;
        }

        $logger = new $loggerClass($logDestination, $logLevel);

        // @codeCoverageIgnoreStart
        if (!($logger instanceof LogInterface)) {
            throw new RuntimeException('Log backend class must implement \\MS\\LightFramework\\Log\\LogInterface');
        }
        // @codeCoverageIgnoreEnd

        return $logger;
    }