public function getChannel($channelName, $config = array())
    {
        if (\strpos($channelName, '.') !== false) {
            $this->error('getChannel(): channelName should not contain period (.)');
            return $this;
        }
        if (!isset($this->channels[$channelName])) {
            // get inherited config
            $cfg = $this->getCfg();
            // remove config values that channel should not inherit
            $cfg = \array_diff_key($cfg, \array_flip(array(
                'errorEmailer',
                'errorHandler',
                'output',
            )));
            unset($cfg['debug']['onBootstrap']);
            // set channel values
            $cfg['debug']['channel'] = $this->parentInstance
                ? $this->cfg['channel'].'.'.$channelName
                : $channelName;
            $cfg['debug']['parent'] = $this;
            // instantiate channel
            $this->channels[$channelName] = new static($cfg);
            // now update config with passed config
            //   since passed config not yet "normalized", merging above not possible
            if ($config) {
                $this->channels[$channelName]->setCfg($config);
            }
        }
        return $this->channels[$channelName];
    }