diff --git a/02_logging.py b/02_logging.py index 92837c6..8b54e8e 100644 --- a/02_logging.py +++ b/02_logging.py @@ -18,11 +18,24 @@ def process_customer(customer_id: str) -> str: return f"Processed {customer_id}" -@flow +@flow(log_prints=True) def main() -> list[str]: + """ + ### 📊 Logging with Prefect + + This flow demonstrates how to use the Prefect logger and capture standard output. + It processes customer data and logs progress at each step. + + **Key Features:** + - Capture standard `print` statements as logs with `log_prints=True`. + - Use the Prefect logger for structured logging in tasks. + - Map tasks across a list of inputs. + """ customer_ids = get_customer_ids() # Map the process_customer task across all customer IDs results = process_customer.map(customer_ids) + + print(f"✅ Successfully processed {len(results)} customers with detailed logging!") return results