def do_cli(function_name, stack_name, filter_pattern, tailing, start_time, end_time):
LOG.debug("<STR_LIT>")<EOL>with LogsCommandContext(function_name,<EOL>stack_name=stack_name,<EOL>filter_pattern=filter_pattern,<EOL>start_time=start_time,<EOL>end_time=end_time,<EOL>output_file=None) as context:<EOL><INDENT>if tailing:<EOL><INDENT>events_iterable = context.fetcher.tail(context.log_group_name,<EOL>filter_pattern=context.filter_pattern,<EOL>start=context.start_time)<EOL><DEDENT>else:<EOL><INDENT>events_iterable = context.fetcher.fetch(context.log_group_name,<EOL>filter_pattern=context.filter_pattern,<EOL>start=context.start_time,<EOL>end=context.end_time)<EOL><DEDENT>formatted_events = context.formatter.do_format(events_iterable)<EOL>for event in formatted_events:<EOL><INDENT>click.echo(event, nl=False)<EOL><DEDENT><DEDENT>
Implementation of the ``cli`` method