Add --use-colors cli option (second attempt) #2708
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
todbt 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
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.