Skip to content

Commit c686c6c

Browse files
committed
Rework cc_verbose
1 parent bfc598d commit c686c6c

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

tools/notifier/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def cc_info(self, info=None):
7878

7979
def cc_verbose(self, message, file=""):
8080
self.notify({
81-
'type': 'info',
81+
'type': 'cc',
8282
'severity': 'verbose',
8383
'file': file,
8484
'message': message

tools/notifier/term.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def notify(self, event):
7979
def print_notify(self, event):
8080
""" Command line notification
8181
"""
82-
if event['type'] == 'tool_error':
82+
if event['type'] in ('tool_error', 'info'):
8383
return event['message']
8484

8585
elif event['type'] == 'cc' and event['severity'] != 'verbose':
@@ -106,21 +106,13 @@ def print_notify(self, event):
106106
def print_notify_verbose(self, event):
107107
""" Command line notification with more verbose mode
108108
"""
109-
if event['type'] == 'info':
109+
if event['type'] == 'info' or (event['type'] == 'cc' and
110+
event['severity'] == 'verbose'):
110111
return event['message']
111112
elif event['type'] == 'debug':
112113
return "[DEBUG] {message}".format(**event)
113-
elif event['type'] == 'cc':
114-
event['severity'] = event['severity'].title()
115-
event['file'] = basename(event['file'])
116-
event['mcu_name'] = "None"
117-
event['tgt_name'] = event.get('target_name', 'unknown').upper()
118-
event['tc_name'] = event.get('toolchain_name', 'unknown').upper()
119-
return ('[{severity}] {tgt_name}::{tc_name}::{file}@{line}: '
120-
'{message}'.format(**event))
121-
122-
elif event['type'] == 'progress':
123-
return self.print_notify(event) # standard handle
114+
elif event['type'] in ('progress', 'cc'):
115+
return self.print_notify(event)
124116

125117
COLOR_MATCHER = re.compile(r"(\w+)(\W+on\W+\w+)?")
126118
def colorstring_to_escapecode(self, color_string):

0 commit comments

Comments
 (0)