Juan Luis Cano RodrĂguez
07/04/2024, 8:29 AMimport logging
from prefect import flow
from prefect.logging import get_run_logger
logger = logging.getLogger(__name__)
@flow
def main_basic():
# logger = get_run_logger()
logger.info("This is an info message")
logger.warning("This is a warning")
logger.error("This is an error")
if __name__ == "__main__":
main_basic()
(continues in đź§µ)
edit: mostly solved âś…Juan Luis Cano RodrĂguez
07/04/2024, 8:30 AMget_run_logger
, but that only works for the flow function. if I have some custom code that is being called, then log output is not being capturedJuan Luis Cano RodrĂguez
07/04/2024, 8:30 AMPREFECT_LOGGING_EXTRA_LOGGERS
, but it seems a bit tedious to specify it for every single library I haveJuan Luis Cano RodrĂguez
07/04/2024, 8:31 AMJuan Luis Cano RodrĂguez
07/04/2024, 8:38 AMJuan Luis Cano RodrĂguez
07/04/2024, 9:20 AMPREFECT_LOGGING_EXTRA_LOGGERS
for now 🙂