From 37d9741401b6c59657c3745f21b468eea1122e62 Mon Sep 17 00:00:00 2001 From: Jim MacArthur Date: Tue, 10 Apr 2018 13:50:18 +0100 Subject: _frontend/widget.py: Correct log line if logdir is empty --- buildstream/_frontend/widget.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'buildstream/_frontend') diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py index a1e8cc3ac..429daaa12 100644 --- a/buildstream/_frontend/widget.py +++ b/buildstream/_frontend/widget.py @@ -276,8 +276,9 @@ class LogFile(Widget): if message.logfile and message.scheduler: logfile = message.logfile - if logfile.startswith(self.logdir) and abbrev: - logfile = logfile[len(self.logdir) + 1:] + if abbrev and self.logdir != "" and logfile.startswith(self.logdir): + logfile = logfile[len(self.logdir):] + logfile = logfile.lstrip(os.sep) if message.message_type in ERROR_MESSAGES: text = self.err_profile.fmt(logfile) -- cgit v1.2.1