summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim MacArthur <jim.macarthur@codethink.co.uk>2018-04-10 13:50:18 +0100
committerJim MacArthur <jim.macarthur@codethink.co.uk>2018-04-10 13:50:53 +0100
commit37d9741401b6c59657c3745f21b468eea1122e62 (patch)
tree417c790f2167b012189499f328b9a8ebddd88e18
parenta867f293352f8db7176a9eaf727b3536b2ea2fae (diff)
downloadbuildstream-37d9741401b6c59657c3745f21b468eea1122e62.tar.gz
_frontend/widget.py: Correct log line if logdir is emptyjmac/logfile-widget-correction
-rw-r--r--buildstream/_frontend/widget.py5
1 files changed, 3 insertions, 2 deletions
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)