def debug_log(msg): ctx = click.get_current_context(True) if ctx and ctx.params.get('debug'): click.echo(msg)