From 529440a0107513ca21aa737f63f79e67d4c658e8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 12 Jul 2023 13:52:05 -0700 Subject: [PATCH] Do not log traceback when log format is json (#7973) (#8056) * do not log traceback when log format is json * changelog (cherry picked from commit 283f716938ec2ad840427639c0b19db2fcdae07b) Co-authored-by: Chenyu Li --- .changes/unreleased/Fixes-20230627-224355.yaml | 6 ++++++ core/dbt/events/functions.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixes-20230627-224355.yaml diff --git a/.changes/unreleased/Fixes-20230627-224355.yaml b/.changes/unreleased/Fixes-20230627-224355.yaml new file mode 100644 index 00000000000..ac396f7e993 --- /dev/null +++ b/.changes/unreleased/Fixes-20230627-224355.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Fix producing non json log when log format is json +time: 2023-06-27T22:43:55.071123-07:00 +custom: + Author: ChenyuLInx + Issue: "7972" diff --git a/core/dbt/events/functions.py b/core/dbt/events/functions.py index ea2609ef5ae..bb96add6f82 100644 --- a/core/dbt/events/functions.py +++ b/core/dbt/events/functions.py @@ -363,7 +363,7 @@ def fire_event(e: Event) -> None: STDOUT_LOG, level_tag=e.level_tag(), log_line=log_line, - exc_info=e.exc_info, + exc_info=False if flags.LOG_FORMAT == "json" else e.exc_info, stack_info=e.stack_info, extra=e.extra )