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

add log-format flag (#1237) #1791

Merged
merged 2 commits into from
Oct 2, 2019

Conversation

beckjake
Copy link
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
Copy link
Contributor

@drewbanin drewbanin left a comment

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!

core/dbt/main.py Outdated
@@ -740,6 +740,13 @@ def parse_args(args):
'''
)

p.add_argument(
'--log-format',
choices=['text', 'json', None],
Copy link
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
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
Copy link
Contributor

@drewbanin drewbanin left a comment

Choose a reason for hiding this comment

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

ship it!

@beckjake beckjake merged commit 3765435 into dev/louisa-may-alcott Oct 2, 2019
@beckjake beckjake deleted the feature/log-format-parameter branch October 2, 2019 15:00
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