to log during my flow and task runs.
However I run into the issue when developing locally that the logger throws an error if it is run without a flow or task run context.
Its particularly annoying when I use pycharm's debugger because if I use the debugger on a "dummy" flow then the cloud UI tends to get messy with one-off flows.
Has anyone faced this issue and figured out a fix?
t
Tim Galvin
11/29/2023, 1:46 AM
I avoid that logger handler outright. If you are building a module that is using a logger object, you can use the environment variable:
Copy code
export PREFECT_LOGGING_EXTRA_LOGGERS="flint"
to attach the prefect api handler that way.
m
Manoj Ravi
12/01/2023, 9:28 AM
@Tim Galvin, do you have any suggestions on what should i do if im using loguru for logging inside the flow code.
I tried
export PREFECT_LOGGING_EXTRA_LOGGERS="loguru"
but didnt work
t
Tim Galvin
12/02/2023, 12:44 PM
I don't sorry. Is logguru a wrapper around the stdlb logging? If so, you don't want to attach the logguru as at the extra module -- you want to add whatever your actual module that is using logguru is called
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.