flint.prefect.helpers

Assorted bits and pieces to help with prefect interactions.

Not intended to contain any common task decorated functions

Functions

enable_loguru_support(→ None)

Redirect loguru logging messages to the prefect run logger.

Module Contents

flint.prefect.helpers.enable_loguru_support() None[source]

Redirect loguru logging messages to the prefect run logger. This function should be called from within a Prefect task or flow before calling any module that uses loguru. This function can be safely called multiple times.

Example Usage:

>>> from prefect import flow
>>> from loguru import logger
>>> from prefect_utils import enable_loguru_support # import this function in your flow from your module
>>> @flow()
>>> def myflow():
>>>     logger.info("This is hidden from the Prefect UI")
>>>     enable_loguru_support()
>>>     logger.info("This shows up in the Prefect UI")