You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Disable colored output and progress bar when building outside of a TTY
This makes the output more readable if it is written to a file,
and more compact in continuous integration environments, keeping
the log sizes low.
(cherry picked from commit bf32d36230)
This commit is contained in:
committed by
Rémi Verschelde
parent
15aa6e2ce7
commit
2055e84641
@@ -438,7 +438,12 @@ node_count_max = 0
|
|||||||
node_count_interval = 1
|
node_count_interval = 1
|
||||||
if ('env' in locals()):
|
if ('env' in locals()):
|
||||||
node_count_fname = str(env.Dir('#')) + '/.scons_node_count'
|
node_count_fname = str(env.Dir('#')) + '/.scons_node_count'
|
||||||
show_progress = env['progress'] == 'yes'
|
# Progress reporting is not available in non-TTY environments since it
|
||||||
|
# messes with the output (for example, when writing to a file)
|
||||||
|
if sys.stdout.isatty():
|
||||||
|
show_progress = env['progress']
|
||||||
|
else:
|
||||||
|
show_progress = False
|
||||||
|
|
||||||
import time, math
|
import time, math
|
||||||
|
|
||||||
|
|||||||
30
methods.py
30
methods.py
@@ -1468,18 +1468,26 @@ def save_active_platforms(apnames, ap):
|
|||||||
|
|
||||||
def no_verbose(sys, env):
|
def no_verbose(sys, env):
|
||||||
|
|
||||||
# If the output is not a terminal, do nothing
|
|
||||||
if not sys.stdout.isatty():
|
|
||||||
return
|
|
||||||
|
|
||||||
colors = {}
|
colors = {}
|
||||||
colors['cyan'] = '\033[96m'
|
|
||||||
colors['purple'] = '\033[95m'
|
# Colors are disabled in non-TTY environments such as pipes. This means
|
||||||
colors['blue'] = '\033[94m'
|
# that if output is redirected to a file, it will not contain color codes
|
||||||
colors['green'] = '\033[92m'
|
if sys.stdout.isatty():
|
||||||
colors['yellow'] = '\033[93m'
|
colors['cyan'] = '\033[96m'
|
||||||
colors['red'] = '\033[91m'
|
colors['purple'] = '\033[95m'
|
||||||
colors['end'] = '\033[0m'
|
colors['blue'] = '\033[94m'
|
||||||
|
colors['green'] = '\033[92m'
|
||||||
|
colors['yellow'] = '\033[93m'
|
||||||
|
colors['red'] = '\033[91m'
|
||||||
|
colors['end'] = '\033[0m'
|
||||||
|
else:
|
||||||
|
colors['cyan'] = ''
|
||||||
|
colors['purple'] = ''
|
||||||
|
colors['blue'] = ''
|
||||||
|
colors['green'] = ''
|
||||||
|
colors['yellow'] = ''
|
||||||
|
colors['red'] = ''
|
||||||
|
colors['end'] = ''
|
||||||
|
|
||||||
compile_source_message = '%sCompiling %s==> %s$SOURCE%s' % (colors['blue'], colors['purple'], colors['yellow'], colors['end'])
|
compile_source_message = '%sCompiling %s==> %s$SOURCE%s' % (colors['blue'], colors['purple'], colors['yellow'], colors['end'])
|
||||||
java_compile_source_message = '%sCompiling %s==> %s$SOURCE%s' % (colors['blue'], colors['purple'], colors['yellow'], colors['end'])
|
java_compile_source_message = '%sCompiling %s==> %s$SOURCE%s' % (colors['blue'], colors['purple'], colors['yellow'], colors['end'])
|
||||||
|
|||||||
Reference in New Issue
Block a user