Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Disable rich logging handler when env var FLYTE_SDK_RICH_TRACEBACKS=0 is set #1760

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

fg91
Copy link
Member

@fg91 fg91 commented Jul 21, 2023

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

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

…s set to 0

Signed-off-by: Fabio Grätz <fabiogratz@googlemail.com>
@fg91 fg91 merged commit d90385a into master Jul 21, 2023
130 checks passed
@fg91 fg91 deleted the fg91/feat/disable-rich-logging-handler branch July 21, 2023 17:36
fg91 added a commit that referenced this pull request Aug 15, 2023
…s set to 0 (#1760)

Signed-off-by: Fabio Grätz <fabiogratz@googlemail.com>
Co-authored-by: Fabio Grätz <fabiogratz@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants