mesonbuild/meson

Add meson option to force color output when output is not tty

Open

#2 486 ouverte le 12 oct. 2017

Voir sur GitHub
 (2 commentaires) (8 réactions) (0 assignés)Python (1 465 forks)batch import
enhancementhelp wanted

Métriques du dépôt

Stars
 (4 978 stars)
Métriques de merge PR
 (Merge moyen 139j 13h) (51 PRs mergées en 30 j)

Description

meson disables color output if stdout is not tty, as below:

mesonbuild/mlog.py:

colorize_console = platform.system().lower() != 'windows' and os.isatty(sys.stdout.fileno()) and \ os.environ.get('TERM') != 'dumb'

This works good normally. But colored log files are needed for sharing log across html email / link ( to pin point the exact areas of concern ( red / yellow warnings etc ). Colored output is much faster to debug than plain text. Screenshot is a very limiting option. An option to meson ( similar to ls --color=always ) should help here.

Example color log file:

root@vbox:~# apt-get install aha

set colorize_console = True in mesonbuild/mlog.py

user@vbox:/local/meson/source$ meson ../build | aha > ../build/log.html

meson-color-output

Guide contributeur