Skip to content

Commit

Permalink
Fix display output in logs
Browse files Browse the repository at this point in the history
Background:
#1235 (comment)

Ansible bases the log level based on colour (yeah, it's dumb) when
logging is enabled. `bright gray` was a valid log level mapping.

Instead of trying to pick some other colur supported in both contexts,
we can just set `screen_only` to skip these messages which are meant for
STDOUT anyway.
  • Loading branch information
swalkinshaw committed Oct 28, 2021
1 parent 9efb598 commit 97980ef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/trellis/utils/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ def display(obj, result):
hr = '-' * int(wrap_width*.67)

if obj.task_failed and first:
display(system(obj.vagrant_version), 'bright gray')
display(hr, 'bright gray')
display(system(obj.vagrant_version), 'bright gray', screen_only=True)
display(hr, 'bright gray', screen_only=True)

if msg == '':
if obj.task_failed and not first:
display(hr, 'bright gray')
display(hr, 'bright gray', screen_only=True)
else:
return
else:
if not first:
display(hr, 'bright gray')
display(hr, 'bright gray', screen_only=True)
display(msg, 'red' if obj.task_failed else 'bright purple')

def display_host(obj, result):
Expand Down

0 comments on commit 97980ef

Please sign in to comment.