<#5436 [Core Feature] Local logs for local contain...
# flytekit
a
#5436 [Core Feature] Local logs for local container task executions. Issue created by dansola It would be nice if we could have something like a boolean flag that controls if local container tasks output logs to the terminal. I think think could be added somewhere around here using the
.logs()
method of the docker client shown on this page. An example of the SDK UX could be something like this:
Copy code
from flytekit import ContainerTask, workflow

echo_container_task = ContainerTask(
    name="echo",
    image="alpine:latest",
    command=["echo", "'a test to show stdout'"],
    local_logs=True,
)

@workflow
def echo_workflow() -> None:
    return echo_container_task()

if __name__ == "__main__":
    print(echo_workflow())
where
local_logs
is ignored if it is a remote execution. flyteorg/flyte