def setup_logging():
    handler = logging.StreamHandler((sys.stdout if settings.LOG_STDOUT else sys.stderr))
    formatter = logging.Formatter(settings.LOG_FORMAT)
    handler.setFormatter(formatter)
    logging.getLogger().addHandler(handler)
    logging.getLogger().setLevel(settings.LOG_LEVEL)
    if (settings.LOG_LEVEL != 'DEBUG'):
        logging.getLogger('passlib').setLevel('ERROR')
        logging.getLogger('requests.packages.urllib3').setLevel('ERROR')
        logging.getLogger('snowflake.connector').setLevel('ERROR')
        logging.getLogger('apiclient').setLevel('ERROR')
def setup_logging():
    handler = logging.StreamHandler((sys.stdout if settings.LOG_STDOUT else sys.stderr))
    formatter = logging.Formatter(settings.LOG_FORMAT)
    handler.setFormatter(formatter)
    logging.getLogger().addHandler(handler)
    logging.getLogger().setLevel(settings.LOG_LEVEL)
    if (settings.LOG_LEVEL != 'DEBUG'):
        logging.getLogger('passlib').setLevel('ERROR')
        logging.getLogger('requests.packages.urllib3').setLevel('ERROR')
        logging.getLogger('snowflake.connector').setLevel('ERROR')
        logging.getLogger('apiclient').setLevel('ERROR')