Improve Vogar defaults for ANSI and color output

System.console() should be null if stdin (or stdout) is
redirected. When there is no console, default to a non-ANSI terminal.

When the terminal kind is ANSI, check whether TERM is defined and
contains the string color. If not, default to a non-color terminal.

Test: art/test/ --mode=host | tee log.txt
Test: art/test/ --mode=host
Bug: 130709497
Change-Id: Ibb2562c9cb4803d3a559a5f85f9e491f6f5e2433
1 file changed