Пример #1
0
def _configure_logging(logger, loglevel):
    """Configure `logger` root logger."""
    # TODO: move to dwave "common utils" module

    formatter = logging.Formatter('%(asctime)s %(name)s %(levelname)s %(threadName)s %(message)s')
    handler = logging.StreamHandler()
    handler.setFormatter(formatter)

    logger.addHandler(handler)

    set_loglevel(logger, loglevel)
Пример #2
0
def enable_loglevel(ctx, param, value):
    if value and not ctx.resilient_parsing:
        set_loglevel(dwave.cloud.logger, value)
Пример #3
0
def _apply_loglevel_from_env(logger):
    set_loglevel(logger, os.getenv('DWAVE_LOG_LEVEL'))