Output channels

def channels(self):
        """Output channels"""
        try:
            return self._channels
        except AttributeError:
            logger.debug("initialize output channels ...")

        channels = self.args.channels
        config_channels = [sec.rpartition('_')[0] for sec in self.config.sections(suffix='_channel')]
        unknown = set(channels) - set(config_channels)
        if unknown:
            raise ValueError("undefined channel %r" % list(unknown))

        output_channels = []
        for channel in set(channels):
            channel_type = self.config.get('%s_channel' % channel, 'type')
            if channel_type == 'tty':
                output_channels.append(TermChannel(channel, self.args, self.config))
            elif channel_type == 'file':
                output_channels.append(FileChannel(channel, self.args, self.config))
            elif channel_type == 'mail':
                output_channels.append(MailChannel(channel, self.args, self.config))
            else:
                raise LogRaptorConfigError('unknown channel type %r' % channel_type)
        return output_channels