<?php

declare(strict_types=1);

namespace Apexl\Io\Logger\Services\HandlerCreator;

use Apexl\Io\Logger\Dtos\HandlerConfig;
use Apexl\Io\Logger\Dtos\StreamConfig;
use Apexl\Io\Logger\Interfaces\HandlerCreatorInterface;

abstract readonly class HandlerCreator implements HandlerCreatorInterface
{
    protected function level(
        HandlerConfig $handlerConfig,
        StreamConfig $streamConfig,
    ): string {
        return ($handlerConfig->level ?? $streamConfig->level)->value;
    }
}