Has anyone integrated Prefect with Loguru on their end and been able to make the Loguru logs show up in the Prefect UI? Since Loguru uses an anonymous logger it seems like
Exactly what I was looking for! I'll make sure to check the Discourse next time, for some reason none of my Loguru + Prefect related searches turned this thread up.
Wrapping it in a decorator and decorating at the flow level allowed me to pass through all logs from the flow itself, subflows, tasks and ordinary python functions called as part of the run, that makes it way less of a hassle too!
panda dancing 1
✨ 1
m
Manoj Ravi
12/04/2023, 9:27 AM
Hello @Morten Hauge, Would like to ask if you have figured out the loguru usage with Prefect , and would be nice if you could share some inputs on implementing this.
m
Morten Hauge
12/04/2023, 10:18 AM
Hi @Manoj Ravi. I went with the solution described above, and that's working well for me! I feel like using a decorator works better than manually calling a setup-function at the start of each task and flow.
m
Manoj Ravi
12/04/2023, 11:19 AM
Thanks for the response @Morten Hauge, Assume you went ahead with creating the enable_loguru_support function which is called inside the flow and would like to ask are there any changes to be done based on the recent prefect versions. I will give it a try anyway. I didn't quite get decorator part, but would like to hear from you in case if you have tested the approach as that sounds better approach.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.