@build.command()<EOL>@click.option('<STR_LIT>', '<STR_LIT>', is_flag=True, help="<STR_LIT>")<EOL>@click.option('<STR_LIT>', '<STR_LIT>', is_flag=True, default=False,<EOL>help="<STR_LIT>")<EOL>@click.option('<STR_LIT>', is_flag=True, default=False,<EOL>help="<STR_LIT>")<EOL>@click.pass_context<EOL>@clean_outputs<EOL>def logs(ctx, past, follow, hide_time):
user, project_name, _build = get_build_or_local(ctx.obj.get('<STR_LIT>'), ctx.obj.get('<STR_LIT>'))<EOL>if past:<EOL><INDENT>try:<EOL><INDENT>response = PolyaxonClient().build_job.logs(<EOL>user, project_name, _build, stream=False)<EOL>get_logs_handler(handle_job_info=False,<EOL>show_timestamp=not hide_time,<EOL>stream=False)(response.content.decode().split('<STR_LIT:\n>'))<EOL>print()<EOL>if not follow:<EOL><INDENT>return<EOL><DEDENT><DEDENT>except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:<EOL><INDENT>if not follow:<EOL><INDENT>Printer.print_error('<STR_LIT>'.format(_build))<EOL>Printer.print_error('<STR_LIT>'.format(e))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT><DEDENT><DEDENT>try:<EOL><INDENT>PolyaxonClient().build_job.logs(<EOL>user,<EOL>project_name,<EOL>_build,<EOL>message_handler=get_logs_handler(handle_job_info=False, show_timestamp=not hide_time))<EOL><DEDENT>except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:<EOL><INDENT>Printer.print_error('<STR_LIT>'.format(_build))<EOL>Printer.print_error('<STR_LIT>'.format(e))<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>
Get build logs.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Examples:

    \b
    ```bash
    $ polyaxon build -b 2 logs
    ```

    \b
    ```bash
    $ polyaxon build logs
    ```