Autarky\Logging\ChannelManager::getChannel PHP Method

getChannel() public method

Get a specific channel.
public getChannel ( string $channel = null ) : Psr\Log\LoggerInterface
$channel string Optional - if none, use default channel
return Psr\Log\LoggerInterface
    public function getChannel($channel = null)
    {
        $channel = $channel ?: $this->defaultChannel;
        if (isset($this->deferredChannels[$channel])) {
            $this->setChannel($channel, $this->deferredChannels[$channel]());
            unset($this->deferredChannels[$channel]);
        }
        if (isset($this->channels[$channel])) {
            return $this->channels[$channel];
        }
        throw new InvalidArgumentException("Undefined channel: {$channel}");
    }