You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2022/07/03 10:51:46 UTC

[buildstream] branch tristan/log-bst-version created (now 88fa7352f)

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

tvb pushed a change to branch tristan/log-bst-version
in repository https://gitbox.apache.org/repos/asf/buildstream.git


      at 88fa7352f _messenger.py: Record the date and buildstream version in every log

This branch includes the following new commits:

     new 88fa7352f _messenger.py: Record the date and buildstream version in every log

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[buildstream] 01/01: _messenger.py: Record the date and buildstream version in every log

Posted by tv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch tristan/log-bst-version
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 88fa7352f8250af33cb03bbefdf969631c37185e
Author: Tristan van Berkom <tr...@codethink.co.uk>
AuthorDate: Sun Jul 3 19:50:52 2022 +0900

    _messenger.py: Record the date and buildstream version in every log
    
    Fixes #184
---
 src/buildstream/_messenger.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/buildstream/_messenger.py b/src/buildstream/_messenger.py
index 5e60cbece..580872df7 100644
--- a/src/buildstream/_messenger.py
+++ b/src/buildstream/_messenger.py
@@ -26,6 +26,7 @@ from . import _signals
 from ._exceptions import BstError
 from ._message import Message, MessageType, unconditional_messages
 from ._state import State, Task
+from . import __version__
 
 
 _RENDER_INTERVAL: datetime.timedelta = datetime.timedelta(seconds=1)
@@ -414,6 +415,11 @@ class Messenger:
                 except RuntimeError:
                     os.fsync(logfile.fileno())
 
+            # Unconditionally record date and buildstream version at the beginning of any log file
+            #
+            starttime = datetime.datetime.now()
+            logfile.write("BuildStream {} - {}\n".format(__version__, starttime.strftime("%A, %d-%m-%Y at %H:%M:%S")))
+
             self._locals.log_handle = logfile
             with _signals.terminator(flush_log):
                 yield self._locals.log_filename