Khuyen Tran

11/30/2022, 4:30 PM
Tips of the week Prefect logger allows you to leverage Rich to insert their own custom color / styling. Here is an example:
from prefect import flow, get_run_logger

def cow_say():
    logger = get_run_logger()
    <|>("I'm in [red]danger[/red]!")

if __name__ == "__main__":
View more styles in Richโ€™s documentation.
:gratitude-thank-you: 4
๐ŸŽ‰ 4
๐Ÿ™Œ 5

Ryan Peden

11/30/2022, 4:52 PM
You can also use Rich styles in your logging config to alter all Prefect console output. Khuyen wrote a Discourse post last month about logging customization, and I just added a reply that describes how to customize your logging config with Rich styling ๐Ÿ˜„
๐Ÿ™Œ 2