예제 #1
0
파일: commands.py 프로젝트: jyejare/broker
def update_log_level(ctx, param, value):
    silent = False
    if value == "silent":
        silent = True
        value = "info"
    if getattr(logging, value.upper()) is not logger.getEffectiveLevel() or silent:
        b_log.setup_logzero(level=value, silent=silent)
        if not silent:
            click.echo(f"Log level changed to [{value}]")
예제 #2
0
def update_log_level(ctx, param, value):
    if getattr(logging, value.upper()) is not logger.getEffectiveLevel():
        b_log.setup_logzero(level=value)
        click.echo(f"Log level changed to [{value}]")
예제 #3
0
def cli(debug):
    if debug or settings.DEBUG:
        b_log.setup_logzero(level="debug")
    logger.debug("I'm in debug mode")