-
Notifications
You must be signed in to change notification settings - Fork 56
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
Colorize output to terminal #4
base: master
Are you sure you want to change the base?
Conversation
…TDOUT_DISABLE_COLOR_OUTPUT
This definitely needs to be conditional at am minimum. Most of my use of this project is in a 12-factor environment where the output is going to a log file and shouldn't have colors. At a minimum I would check that stdout is a TTY, and that has a TERM that probably supports color, and probably offer an env var or other config option to disable it. |
Agreed. I've added in a check to determine if we should used colorized output. I don't think it is possible to add it as a configuration option in supervisor for eventlisteners, so an env var might be the way to go. |
There are two general purposes where I use this tool.
Unfortunately, a single envvar will not suffice. In the latter, even though it does not output to a terminal or has a tty, we still want the colorized format. Thus, I have introduced two env variables "STDOUT_ALWAYS_ENABLE_COLOR_OUTPUT" and "STDOUT_DISABLE_COLOR_OUTPUT". |
|
||
def supports_color(): | ||
""" | ||
Taken from https://github.com/django/django/blob/master/django/core/management/color.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will require copyright attribution and a license statement for the copied code. Just something like "This code is copyright X and is used under the terms of the Y license".
Updated with copyright attribution and license statement. |
Roger, I'm on a plane tomorrow but will try to look at this once I get back to real networking. Thanks! |
No description provided.