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

Only colourise synctl output when attached to tty #4049

Merged
merged 3 commits into from Oct 18, 2018

Conversation

Projects
None yet
3 participants
@erikjohnston
Copy link
Member

erikjohnston commented Oct 17, 2018

We should probably not be hand rolling this, but I don't want to get lost in a rabbithole of replacing with a proper library.

@erikjohnston erikjohnston force-pushed the erikj/synctl_colour branch from 0703d1f to 1af16ac Oct 17, 2018

@erikjohnston erikjohnston requested a review from matrix-org/synapse-core Oct 17, 2018

synctl Outdated
if colour == NORMAL:
# Lets check if we're writing to a TTY before colouring
should_colour = False
if stream in (sys.stdout, sys.stderr):

This comment has been minimized.

Copy link
@richvdh

richvdh Oct 17, 2018

Member

could you just catch the AttributeError instead?

This comment has been minimized.

Copy link
@richvdh

richvdh Oct 17, 2018

Member

(and maybe not even bother checking if colour==NORMAL)

@erikjohnston erikjohnston merged commit e77f24d into develop Oct 18, 2018

6 checks passed

ci/circleci: sytestpy2merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy2postgresmerged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3postgresmerged Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@erikjohnston erikjohnston deleted the erikj/synctl_colour branch Dec 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.