You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:25:01 UTC

[buildstream] 01/03: plugin.py: Add log() method

This is an automated email from the ASF dual-hosted git repository.

not-in-ldap pushed a commit to branch sam/compose-log-splits
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit f37a8f7033fa28539082b6d30592baaf51881bf2
Author: Sam Thursfield <sa...@codethink.co.uk>
AuthorDate: Wed Nov 8 12:58:21 2017 +0000

    plugin.py: Add log() method
    
    This is a helper to log messages into the plugin's log file.
---
 buildstream/plugin.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/buildstream/plugin.py b/buildstream/plugin.py
index bfa37ef..2521807 100644
--- a/buildstream/plugin.py
+++ b/buildstream/plugin.py
@@ -416,6 +416,18 @@ class Plugin():
         """
         self.__message(MessageType.LOG, 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