diff options
-rw-r--r-- | buildstream/_frontend/widget.py | 5 |
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) |