Autarky\Logging\ChannelManager::setChannel PHP Method

setChannel() public method

Set a channel instance.
public setChannel ( string $channel, Psr\Log\LoggerInterface $logger )
$channel string
$logger Psr\Log\LoggerInterface
    public function setChannel($channel, LoggerInterface $logger)
    {
        if (isset($this->channels[$channel])) {
            throw new InvalidArgumentException("Channel {$channel} is already defined");
        }
        $this->channels[$channel] = $logger;
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function configure()
 {
     $this->channelManager->setChannel('default', $this->makeDefaultLogger());
 }