def set_logging(log, loglevelnum, logfile, verbose_console=False):
    """Configure standard logging for the application. One ERROR level handler to stderr and one file handler with specified loglevelnum to logfile.
        log argument is the main (parent) application logger.
    """
    # Prevent common error in using this API: loglevelnum is numeric
    if not loglevelnum in [logging.NOTSET, logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL]:
        log.error("Incorrect loglevel value")
        sys.exit(1)

    try:
        # Specific log levels are set on individual handlers, but we must also set the most permissive log level on the logger itself to pass the initial filter.
        log.setLevel(logging.DEBUG)
        fh = logging.FileHandler(logfile)
        fh.setLevel(loglevelnum)
        fh.setFormatter(logging.Formatter('%(asctime)s %(levelname)-8s %(filename)s:%(lineno)d.%(funcName)s() - %(message)s'))
        log.addHandler(fh)
        ch = logging.StreamHandler()
        if verbose_console:
            ch.setLevel(logging.DEBUG)
        else:
            ch.setLevel(logging.ERROR)
        ch.setFormatter(logging.Formatter('%(levelname)s %(message)s'))
        log.addHandler(ch)
        # add log file handler for libraries according to the logging convention
        logging.getLogger('lib').addHandler(fh)    
    except __HOLE__, e:
        msg = str(e)
        if e.errno == 13:
            msg += '\nYou need to be root'
        raise ConfigError(msg)
dataset/ETHPy150Open securitykiss-com/rfw/rfw/config.py/set_logging