Tips of the week Prefect logger allows you to lev...
# prefect-getting-started
k
Tips of the week Prefect logger allows you to leverage Rich to insert their own custom color / styling. Here is an example:
Copy code
from prefect import flow, get_run_logger

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

if __name__ == "__main__":
    cow_say()
View more styles in Richโ€™s documentation.
gratitude thank you 4
๐ŸŽ‰ 4
๐Ÿ™Œ 5
r
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