Skip to content

add log-format flag (#1237)#1791

Merged
beckjake merged 2 commits into
dev/louisa-may-alcottfrom
feature/log-format-parameter
Oct 2, 2019
Merged

add log-format flag (#1237)#1791
beckjake merged 2 commits into
dev/louisa-may-alcottfrom
feature/log-format-parameter

Conversation

@beckjake

Copy link
Copy Markdown
Contributor

Fixes #1237

Add a --log-format flag. It accepts text and json as valid arguments. All dbt tasks should honor it, it formats the command's output as the specified format instead of the task's default.

Tasks that use print (dbt ls and dbt debug) are mostly not changed by this flag, though messages that go through the logger, such as dbt ls's stderr output, will be transformed.

@beckjake beckjake requested a review from drewbanin September 27, 2019 17:25
@cla-bot cla-bot Bot added the cla:yes label Sep 27, 2019

@drewbanin drewbanin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one comment about the CLI flag but this broadly looks good to me!

Comment thread core/dbt/main.py Outdated

p.add_argument(
'--log-format',
choices=['text', 'json', None],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think it would be clearer to use default instead of None?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it matters much, but we can!

@beckjake beckjake requested a review from drewbanin October 2, 2019 13:15

@drewbanin drewbanin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ship it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a JSON logger to the project

2 participants