diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-11-08 12:58:21 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-11-28 18:09:16 +0000 |
commit | 3ec023aa86a593c0eb9dbe1e5f6634b1f5544e6a (patch) | |
tree | 8bdd66613fa7e9b9fb5f35dbfa2a55eb1511530e | |
parent | 02cc8d03faf9201847e173d2d1474f8dd0fd3c30 (diff) | |
download | buildstream-sam/plugin-log.tar.gz |
plugin.py: Add log() methodsam/plugin-log
This is a helper to log messages into the plugin's log file.
-rw-r--r-- | buildstream/plugin.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/buildstream/plugin.py b/buildstream/plugin.py index 30f4c1cb2..5151da85a 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 |