def METHOD_NAME(log_file, verbosity, append):
    level = {0: logging.ERROR,
             1: logging.WARNING,
             2: logging.INFO}.get(verbosity, logging.DEBUG)
    if log_file is not None:
        handler = logging.FileHandler(log_file, mode=(append and 'a' or 'w'))
    else:
        handler = logging.StreamHandler()
    handler.setFormatter(logging.Formatter(
        "%(threadName)s::%(levelname)s::%(asctime)s::%(module)s::"
        + "%(lineno)d::%(name)s::(%(funcName)s) %(message)s"))
    root_logger = logging.getLogger('')
    root_logger.setLevel(level)
    root_logger.addHandler(handler)