Shane Breeze
06/14/2023, 7:40 AMMarvin
06/14/2023, 7:41 AMlog_prints parameter. To hide task logs from the flow logs, you can set log_prints=False for the tasks you want to silence. Here's an example:
python
from prefect import flow, task
@task(log_prints=False)
def my_task():
print("not logging print statements in this task")
@flow(log_prints=True)
def my_flow():
print("we're logging print statements from a flow")
my_task()
In this example, the my_task function will not log its print statements, while the my_flow function will log its print statements. This way, you can selectively hide task logs from the flow logs (source).
Remember, though, that with great power comes great responsibility. Don't forget to check the task logs when you need them!Shane Breeze
06/14/2023, 7:44 AMmy_task logs, I just want to hide them in the log tab of the flow run in the UI. I still want to see the my_task logs in the log tab of the individual task runMarvin
06/14/2023, 7:44 AM