)]}'
{"stackrc":[{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"8e395cb71726c6101692200685ee7b8f1db75954","unresolved":false,"context_lines":[{"line_number":143,"context_line":"    # tput requires TERM or -T"},{"line_number":144,"context_line":"    TPUT_T\u003d"},{"line_number":145,"context_line":"    if ! [ $TERM ]; then"},{"line_number":146,"context_line":"        TPUT_T\u003d\u0027-T vt100\u0027"},{"line_number":147,"context_line":"    fi"},{"line_number":148,"context_line":"    export PS4\u003d\u0027+\\[$(tput \u0027$TPUT_T\u0027 setaf 242)\\]$(short_source)\\[$(tput \u0027$TPUT_T\u0027 sgr0)\\] \u0027"},{"line_number":149,"context_line":"else"}],"source_content_type":"application/x-shellscript","patch_set":2,"id":"7aa08908_4f3cd8c7","line":146,"updated":"2016-06-15 00:49:13.000000000","message":"so i\u0027m not really convinced on this.  \n\nI presume you want this so that you\u0027re running stack.sh from a non-interactive ssh session but you want these escape codes put into the log file so when you display it back with \"cat\" you see the colors?\n\nBut just as often people just want a plain-log file in this case, for display via http or download, etc.\n\nSo what I\u0027d rather see us do is switch to default LOG_COLOR to False if output is not going to a tty (\"if [ -t 1 ]\").  I think this follows POLS.\n\nIf we make the change to default False when no tty, we could maybe do this fake vt100 TERM if LOG_COLOR is forced to true ... that probably means that someone went out of their way to set LOG_COLOR so they know what they want","commit_id":"14fc4cc53db308ec0e0d2af76004b10967ba1d51"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a00f3d391ffd829b36b78631090d3e265d080aac","unresolved":false,"context_lines":[{"line_number":143,"context_line":"    # tput requires TERM or -T"},{"line_number":144,"context_line":"    TPUT_T\u003d"},{"line_number":145,"context_line":"    if ! [ $TERM ]; then"},{"line_number":146,"context_line":"        TPUT_T\u003d\u0027-T vt100\u0027"},{"line_number":147,"context_line":"    fi"},{"line_number":148,"context_line":"    export PS4\u003d\u0027+\\[$(tput \u0027$TPUT_T\u0027 setaf 242)\\]$(short_source)\\[$(tput \u0027$TPUT_T\u0027 sgr0)\\] \u0027"},{"line_number":149,"context_line":"else"}],"source_content_type":"application/x-shellscript","patch_set":2,"id":"7aa08908_c230f6a0","line":146,"in_reply_to":"7aa08908_40f2739b","updated":"2016-06-17 19:43:06.000000000","message":"Done","commit_id":"14fc4cc53db308ec0e0d2af76004b10967ba1d51"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5d487a5f70aedfb47d5399685ae1d36fda581275","unresolved":false,"context_lines":[{"line_number":143,"context_line":"    # tput requires TERM or -T"},{"line_number":144,"context_line":"    TPUT_T\u003d"},{"line_number":145,"context_line":"    if ! [ $TERM ]; then"},{"line_number":146,"context_line":"        TPUT_T\u003d\u0027-T vt100\u0027"},{"line_number":147,"context_line":"    fi"},{"line_number":148,"context_line":"    export PS4\u003d\u0027+\\[$(tput \u0027$TPUT_T\u0027 setaf 242)\\]$(short_source)\\[$(tput \u0027$TPUT_T\u0027 sgr0)\\] \u0027"},{"line_number":149,"context_line":"else"}],"source_content_type":"application/x-shellscript","patch_set":2,"id":"7aa08908_f26a9980","line":146,"in_reply_to":"7aa08908_4f3cd8c7","updated":"2016-06-15 20:41:33.000000000","message":"Thanks for the review, Ian.  What\u0027s POLS?\n\nI wasn\u0027t trying to make a functional change here.  I assumed sdague had that part right.  I just wanted to fix the error message that gets spit out twice per log entry when LOG_COLOR is enabled, but TERM/-T aren\u0027t set.\n\nAlso, with your suggestion, how would I get an unattended devstack to log in color?  That\u0027s the exact scenario I was trying to solve.","commit_id":"14fc4cc53db308ec0e0d2af76004b10967ba1d51"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"5b69035df7caa1bb4687b9c8899255283536d1b2","unresolved":false,"context_lines":[{"line_number":143,"context_line":"    # tput requires TERM or -T"},{"line_number":144,"context_line":"    TPUT_T\u003d"},{"line_number":145,"context_line":"    if ! [ $TERM ]; then"},{"line_number":146,"context_line":"        TPUT_T\u003d\u0027-T vt100\u0027"},{"line_number":147,"context_line":"    fi"},{"line_number":148,"context_line":"    export PS4\u003d\u0027+\\[$(tput \u0027$TPUT_T\u0027 setaf 242)\\]$(short_source)\\[$(tput \u0027$TPUT_T\u0027 sgr0)\\] \u0027"},{"line_number":149,"context_line":"else"}],"source_content_type":"application/x-shellscript","patch_set":2,"id":"7aa08908_40f2739b","line":146,"in_reply_to":"7aa08908_b100e101","updated":"2016-06-16 22:33:09.000000000","message":"that looks like what i\u0027d expect for setting log color.  please also add a comment to the TPUT_T that with no term but forced color we\u0027ve chosen to just assume vt100 as it seems like a lowest-common-denominator","commit_id":"14fc4cc53db308ec0e0d2af76004b10967ba1d51"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3417aaa07c696392fb00370ac2578e4a43a6043f","unresolved":false,"context_lines":[{"line_number":143,"context_line":"    # tput requires TERM or -T"},{"line_number":144,"context_line":"    TPUT_T\u003d"},{"line_number":145,"context_line":"    if ! [ $TERM ]; then"},{"line_number":146,"context_line":"        TPUT_T\u003d\u0027-T vt100\u0027"},{"line_number":147,"context_line":"    fi"},{"line_number":148,"context_line":"    export PS4\u003d\u0027+\\[$(tput \u0027$TPUT_T\u0027 setaf 242)\\]$(short_source)\\[$(tput \u0027$TPUT_T\u0027 sgr0)\\] \u0027"},{"line_number":149,"context_line":"else"}],"source_content_type":"application/x-shellscript","patch_set":2,"id":"7aa08908_b100e101","line":146,"in_reply_to":"7aa08908_f26a9980","updated":"2016-06-16 16:05:11.000000000","message":"Ian, I believe your suggestion would entail leaving the proposed delta as-is, and changing the above assignment of LOG_COLOR as follows:\n\n diff --git a/stackrc b/stackrc\n index c8554f9..d588d56 100644\n --- a/stackrc\n +++ b/stackrc\n @@ -135,8 +135,15 @@ elif [[ -f $RC_DIR/.localrc.auto ]]; then\n      source $RC_DIR/.localrc.auto\n  fi\n \n +# Default for log coloring is based on interactive-or-not\n +if [ -t 1 ]; then\n +    _LOG_COLOR_DEFAULT\u003dTrue\n +else\n +    _LOG_COLOR_DEFAULT\u003dFalse\n +fi\n +\n  # Use color for logging output (only available if syslog is not used)\n -LOG_COLOR\u003d$(trueorfalse True LOG_COLOR)\n +LOG_COLOR\u003d$(trueorfalse $_LOG_COLOR_DEFAULT LOG_COLOR)\n \n  # Make tracing more educational\n  if [[ \"$LOG_COLOR\" \u003d\u003d \"True\" ]]; then","commit_id":"14fc4cc53db308ec0e0d2af76004b10967ba1d51"}]}
