Join Slack
Powered by
Is there anyway to add the output of a command to ...
# ask-community
m
Matthew Maldonado
04/29/2020, 2:20 AM
Is there anyway to add the output of a command to the prefect logs
c
Chris White
04/29/2020, 2:23 AM
You could follow a pattern similar to this:
https://github.com/PrefectHQ/prefect/blob/master/src/prefect/tasks/shell.py#L97-L103
Also note that you can initialize tasks with
log_stdout=True
which will attempt to convert all stdout within your task into a prefect log, e.g.
Copy code
@task(log_stdout=True) def my_task(): ...
upvote
1
Open in Slack
Previous
Next