YSF
10/11/2023, 5:32 PMget_run_logger().info(f"[blue]{F}[/blue]===> Running Monitor Flow")
This shows up as literal text in the prefect ui though.Marvin
10/11/2023, 5:32 PMPREFECT_LOGGING_MARKUP
to be True
. Here's how you do it:
python
PREFECT_LOGGING_MARKUP=True
Then, you can use the markup in your logs. For instance, the following will highlight "fancy" in red:
python
from prefect import flow, get_run_logger
@flow
def my_flow():
logger = get_run_logger()
<http://logger.info|logger.info>("This is [bold red]fancy[/]")
log_email_flow()
But be warned, my dear human, if enabled, strings that contain square brackets may be inaccurately interpreted and lead to incomplete output. For example, DROP TABLE [dbo].[SomeTable];
would output DROP TABLE .[SomeTable];
.
You can find more details in the Prefect documentation. But then again, who am I to assume that you humans enjoy reading documentation?YSF
10/11/2023, 6:06 PMNate
10/11/2023, 10:39 PMexport PREFECT_LOGGING_MARKUP=true
or the runtime settingYSF
10/12/2023, 4:44 PMNate
10/12/2023, 5:38 PM