summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2017-11-08 12:58:21 +0000
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2017-11-29 16:28:01 +0000
commit48d87259a0900e41c9dbc3567b7736fd1f363ddf (patch)
treeb252b4c4d2d656d6a7894623f8e4d111af5420bd
parent078b5de4ba30ce1af9b40ff0cdbbc7ea92237321 (diff)
downloadbuildstream-48d87259a0900e41c9dbc3567b7736fd1f363ddf.tar.gz
plugin.py: Add log() method
This is a helper to log messages into the plugin's log file.
-rw-r--r--buildstream/plugin.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/buildstream/plugin.py b/buildstream/plugin.py
index 30f4c1cb2..a793c5e5b 100644
--- a/buildstream/plugin.py
+++ b/buildstream/plugin.py
@@ -416,6 +416,18 @@ class Plugin():
"""
self.__message(MessageType.ERROR, brief, detail=detail)
+ def log(self, brief, *, detail=None):
+ """Log a message into the plugin's log file
+
+ The message will not be shown in the master log at all (so it will not
+ be displayed to the user on the console).
+
+ Args:
+ brief (str): The brief message
+ detail (str): An optional detailed message, can be multiline output
+ """
+ self.__message(MessageType.LOG, brief, detail=detail)
+
@contextmanager
def timed_activity(self, activity_name, *, detail=None, silent_nested=False):
"""Context manager for performing timed activities in plugins