src/Mero/Monolog/MonologComponent.php
public function createChannel($name, array $config)
    {
        $handlers = [];
        $processors = [];
        if (!empty($config['handler']) && is_array($config['handler'])) {
            foreach ($config['handler'] as $handler) {
                if (!is_array($handler) && !$handler instanceof AbstractHandler) {
                    throw new HandlerNotFoundException();
                }
                if (is_array($handler)) {
                    $handlerObject = $this->createHandlerInstance($handler);
                    if (array_key_exists('formatter', $handler) &&
                        $handler['formatter'] instanceof FormatterInterface
                    ) {
                        $handlerObject->setFormatter($handler['formatter']);
                    }
                } else {
                    $handlerObject = $handler;
                }
                $handlers[] = $handlerObject;
            }
        }
        if (!empty($config['processor']) && is_array($config['processor'])) {
            $processors = $config['processor'];
        }
        $this->openChannel($name, $handlers, $processors);

        return;
    }
public function createChannel($name, array $config)
    {
        $handlers = [];
        $processors = [];
        if (!empty($config['handler']) && is_array($config['handler'])) {
            foreach ($config['handler'] as $handler) {
                if (!is_array($handler) && !$handler instanceof AbstractHandler) {
                    throw new HandlerNotFoundException();
                }
                if (is_array($handler)) {
                    $handlerObject = $this->createHandlerInstance($handler);
                    if (array_key_exists('formatter', $handler) &&
                        $handler['formatter'] instanceof FormatterInterface
                    ) {
                        $handlerObject->setFormatter($handler['formatter']);
                    }
                } else {
                    $handlerObject = $handler;
                }
                $handlers[] = $handlerObject;
            }
        }
        if (!empty($config['processor']) && is_array($config['processor'])) {
            $processors = $config['processor'];
        }
        $this->openChannel($name, $handlers, $processors);

        return;
    }
public function createChannel ( $ name , array $ config ) { $ handlers = [ ] ; $ processors = [ ] ; if ( ! empty ( $ config [ 'handler' ] ) && is_array ( $ config [ 'handler' ] ) ) { foreach ( $ config [ 'handler' ] as $ handler ) { if ( ! is_array ( $ handler ) && ! $ handler instanceof AbstractHandler ) { throw new HandlerNotFoundException ( ) ; } if ( is_array ( $ handler ) ) { $ handlerObject = $ this -> createHandlerInstance ( $ handler ) ; if ( array_key_exists ( 'formatter' , $ handler ) && $ handler [ 'formatter' ] instanceof FormatterInterface ) { $ handlerObject -> setFormatter ( $ handler [ 'formatter' ] ) ; } } else { $ handlerObject = $ handler ; } $ handlers [ ] = $ handlerObject ; } } if ( ! empty ( $ config [ 'processor' ] ) && is_array ( $ config [ 'processor' ] ) ) { $ processors = $ config [ 'processor' ] ; } $ this -> openChannel ( $ name , $ handlers , $ processors ) ; return ; }
Create a logger channel.

@param string $name   Logger channel name
@param array  $config Logger channel configuration

@throws \InvalidArgumentException When the channel already exists
@throws HandlerNotFoundException  When a handler configuration is invalid
Create a logger channel .