<#1760 Fix: Disable rich logging handler when env ...
# flyte-github
a
#1760 Fix: Disable rich logging handler when env var `FLYTE_SDK_RICH_TRACEBACKS=0` is set Pull request opened by fg91 Type ☑︎ Bug Fix ☐ Feature ☐ Plugin Are all requirements met? ☑︎ Code completed ☑︎ Smoke tested ☐ Unit tests added ☐ Code documentation added ☑︎ Any pending items have an associated Issue Complete description In #1695 I introduced an environment variable called
FLYTE_SDK_RICH_TRACEBACKS
which, when set to 0, disables rich tracebacks. Setting this environment variable turns this

image

back into:

image

However, in this PR I overlooked that a
RichHandler
is added to the flytekit logger which also produces output in rich format. When executing this workflow
Copy code
from flytekit import task, workflow

@task
def train():
    raise Exception("This is a test")

@workflow
def wf():
    train()

if __name__ == "__main__":
    wf()
with
FLYTE_SDK_RICH_TRACEBACKS=0 python test.py
, the output still looks as follows:

Screenshot_2023-07-21_at_18_44_25

This PR disables this logger as well when the above mentioned environment variable is set. Tracking Issue NA Follow-up issue NA flyteorg/flytekit All checks have passed 30/30 successful checks