diff options
-rw-r--r-- | buildstream/_frontend/widget.py | 30 | ||||
-rw-r--r-- | buildstream/_scheduler/scheduler.py | 4 | ||||
-rw-r--r-- | tests/frontend/logging.py | 4 |
3 files changed, 17 insertions, 21 deletions
diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py index 30c2e9e1a..c43856145 100644 --- a/buildstream/_frontend/widget.py +++ b/buildstream/_frontend/widget.py @@ -175,29 +175,22 @@ class TypeName(Widget): # A widget for displaying the Element name class ElementName(Widget): - def __init__(self, context, content_profile, format_profile): - super(ElementName, self).__init__(context, content_profile, format_profile) - - # Pre initialization format string, before we know the length of - # element names in the pipeline - self._fmt_string = '{: <30}' - def render(self, message): + action_name = message.action_name element_id = message.task_id or message.unique_id - if element_id is None: - return "" - - plugin = _plugin_lookup(element_id) - name = plugin._get_full_name() + if element_id is not None: + plugin = _plugin_lookup(element_id) + name = plugin._get_full_name() + name = '{: <30}'.format(name) + else: + name = 'core activity' + name = '{: <30}'.format(name) - # Sneak the action name in with the element name - action_name = message.action_name if not action_name: action_name = "Main" return self.content_profile.fmt("{: >5}".format(action_name.lower())) + \ - self.format_profile.fmt(':') + \ - self.content_profile.fmt(self._fmt_string.format(name)) + self.format_profile.fmt(':') + self.content_profile.fmt(name) # A widget for displaying the primary message text @@ -219,9 +212,12 @@ class CacheKey(Widget): def render(self, message): element_id = message.task_id or message.unique_id - if element_id is None or not self._key_length: + if not self._key_length: return "" + if element_id is None: + return ' ' * self._key_length + missing = False key = ' ' * self._key_length plugin = _plugin_lookup(element_id) diff --git a/buildstream/_scheduler/scheduler.py b/buildstream/_scheduler/scheduler.py index eb67fed68..7f5249575 100644 --- a/buildstream/_scheduler/scheduler.py +++ b/buildstream/_scheduler/scheduler.py @@ -40,8 +40,8 @@ class SchedStatus(): # Some action names for the internal jobs we launch # -_ACTION_NAME_CLEANUP = 'cleanup' -_ACTION_NAME_CACHE_SIZE = 'cache_size' +_ACTION_NAME_CLEANUP = 'clean' +_ACTION_NAME_CACHE_SIZE = 'size' # Scheduler() diff --git a/tests/frontend/logging.py b/tests/frontend/logging.py index a10f62cc1..3243e74bc 100644 --- a/tests/frontend/logging.py +++ b/tests/frontend/logging.py @@ -41,7 +41,7 @@ def test_default_logging(cli, tmpdir, datafiles): result = cli.run(project=project, args=['source', 'fetch', element_name]) result.assert_success() - m = re.search(r"\[\d\d:\d\d:\d\d\]\[\]\[\] SUCCESS Checking sources", result.stderr) + m = re.search(r"\[\d\d:\d\d:\d\d\]\[\s*\]\[.*\] SUCCESS Checking sources", result.stderr) assert(m is not None) @@ -77,7 +77,7 @@ def test_custom_logging(cli, tmpdir, datafiles): result = cli.run(project=project, args=['source', 'fetch', element_name]) result.assert_success() - m = re.search(r"\d\d:\d\d:\d\d,\d\d:\d\d:\d\d.\d{6},\d\d:\d\d:\d\d,,,SUCCESS,Checking sources", result.stderr) + m = re.search(r"\d\d:\d\d:\d\d,\d\d:\d\d:\d\d.\d{6},\d\d:\d\d:\d\d,\s*,.*,SUCCESS,Checking sources", result.stderr) assert(m is not None) |