diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-11-08 12:58:21 +0000 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2017-11-29 16:28:01 +0000 |
commit | 48d87259a0900e41c9dbc3567b7736fd1f363ddf (patch) | |
tree | b252b4c4d2d656d6a7894623f8e4d111af5420bd | |
parent | 078b5de4ba30ce1af9b40ff0cdbbc7ea92237321 (diff) | |
download | buildstream-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.py | 12 |
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 |