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 --use-colors cli option (second attempt) #2708

Conversation

rsenseman
Copy link
Contributor

@rsenseman rsenseman commented Aug 16, 2020

resolves #2192

Description

New PR with same changes as #2622, I got myself into a Git-mess in PR #2622 when attempting to squash commits.

Adds two new flags --use-colors and --no-use-colors to dbt run command to enable or disable log colorization from the command line. The motivation for this change is to enable running with colorized logs locally and running without colorized logs in production for easier log parsing by other tools.

PR for documentation: dbt-labs/docs.getdbt.com#286

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt next" section.

Testing

Ran locally with all 4 combinations of profiles options use_colors: < true | false > and cli options nothing, --use-colors, and --no-use-colors to make sure overrides work as expected. Also added integrations tests to test that these flags work. Tests for both --use-colors and --no-use-colors implicitly test that default overrides are working.

Successfully ran integration tests with command docker-compose run test tox -e explicit-py36 -- -s -x -m profile_postgres test/integration/061_use_colors_tests/.

Also successfully ran make test-unit to make sure I didn't break anything already in place.

@cla-bot cla-bot bot added the cla:yes label Aug 16, 2020
@rsenseman rsenseman marked this pull request as ready for review August 16, 2020 21:45
Copy link
Contributor

@jtcohen6 jtcohen6 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for opening a new PR. I did the same testing locally and all looks good.

If you can fix the changelog merge conflict, I'm happy with getting this in for our 0.18.0 release candidate.

@rsenseman
Copy link
Contributor Author

@jtcohen6 Merge conflicts are resolved!

@jtcohen6 jtcohen6 merged commit 7ef7a8f into dbt-labs:dev/marian-anderson Aug 19, 2020
@jtcohen6
Copy link
Contributor

Thank you for the contribution!

@rsenseman rsenseman deleted the enhancement/color_output_command_line_flag_second_attempt branch August 19, 2020 17:44
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 command line flag to enable or disable color output
2 participants