From 60eae43ae4de01724b33c441edfef913ed7f2fcd Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 29 Jan 2015 18:05:05 -0500 Subject: [PATCH] Add the date time to the log entries --- buildman/jobutil/buildstatus.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/buildman/jobutil/buildstatus.py b/buildman/jobutil/buildstatus.py index 1b4670c87..217e3aa6c 100644 --- a/buildman/jobutil/buildstatus.py +++ b/buildman/jobutil/buildstatus.py @@ -1,5 +1,6 @@ from data.database import BUILD_PHASE from data import model +import datetime class StatusHandler(object): """ Context wrapper for writing status to build logs. """ @@ -20,6 +21,8 @@ class StatusHandler(object): self.__exit__(None, None, None) def _append_log_message(self, log_message, log_type=None, log_data=None): + log_data = log_data or {} + log_data['datetime'] = str(datetime.datetime.now()) self._build_logs.append_log_message(self._uuid, log_message, log_type, log_data) def append_log(self, log_message, extra_data=None):