Hey,
I’m developing my first Prefect 2 flow after about a year with Prefect 1 (-:
I saw that now to get Prefect’s logger I should run “get_run_logger()“.
Now this works inside a flow or a task context - but what should I do when a task calls a regular python function that contains logs (
logger.info for example)?
For example - In prefect 1 I could write “logger = prefect.context.get(LOGGER_NAME)” at the top of the py file that contained both Prefect tasks and regular python functions (that were used from within tasks), and the logger was used by both.
I tried using “get_run_logger()” at the top of the py file but got this error “There is no active flow or task run context.”
Thanks
@Itay vidal FYI