diff options
author | James Ennis <james.ennis@codethink.co.uk> | 2019-08-08 12:40:05 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-08-09 09:50:15 +0000 |
commit | da0c998a8acbaef5177ccdd5d337b081b0a04f5c (patch) | |
tree | ea9a016102d8683bad63f3dcd6646596cb076a70 | |
parent | 65238dfb61408b31cefe692dda206bc8fd346ae8 (diff) | |
download | buildstream-da0c998a8acbaef5177ccdd5d337b081b0a04f5c.tar.gz |
artifact.py,element.py: Add get_logs() methods
-rw-r--r-- | src/buildstream/_artifact.py | 16 | ||||
-rw-r--r-- | src/buildstream/element.py | 8 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/buildstream/_artifact.py b/src/buildstream/_artifact.py index b6b07ecc1..1512a10a5 100644 --- a/src/buildstream/_artifact.py +++ b/src/buildstream/_artifact.py @@ -89,6 +89,22 @@ class Artifact(): return CasBasedDirectory(self._cas, digest=buildtree_digest) + # get_logs(): + # + # Get the paths of the artifact's logs + # + # Returns: + # (list): A list of object paths + # + def get_logs(self): + artifact = self._get_proto() + + logfile_paths = [] + for logfile in artifact.logs: + logfile_paths.append(self._cas.objpath(logfile.digest)) + + return logfile_paths + # get_extract_key(): # # Get the key used to extract the artifact diff --git a/src/buildstream/element.py b/src/buildstream/element.py index 208bc35b2..240e8ce7d 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -925,6 +925,14 @@ class Element(Plugin): self.__batch_prepare_assemble_flags = flags self.__batch_prepare_assemble_collect = collect + def get_logs(self): + """Obtain a list of log file paths + + Returns: + (list): A list of log file paths + """ + return self.__artifact.get_logs() + ############################################################# # Private Methods used in BuildStream # ############################################################# |