'Configure the main log according to the process\' configuration and
channel. Sets `mainlog` on self. Returns nothing.'

def _setup_logging(self, config, channel):

    logfile = getattr(config, ('%s_logfile' % channel))
    if (not logfile):
        return
    maxbytes = getattr(config, ('%s_logfile_maxbytes' % channel))
    backups = getattr(config, ('%s_logfile_backups' % channel))
    fmt = '%(message)s'
    if (logfile == 'syslog'):
        warnings.warn(("Specifying    'syslog'    for    filename    is    deprecated.    Use    %s_syslog    instead." % channel), DeprecationWarning)
        fmt = '    '.join((config.name, fmt))
    self.mainlog = loggers.handle_file(config.options.getLogger(), filename=logfile, fmt=fmt, rotating=(not (not maxbytes)), maxbytes=maxbytes, backups=backups)
    if getattr(config, ('%s_syslog' % channel), False):
        fmt = (config.name + '    %(message)s')
        loggers.handle_syslog(self.mainlog, fmt)
