Add the date time to the log entries

This commit is contained in:
Joseph Schorr 2015-01-29 18:05:05 -05:00
parent ce3f8b438c
commit 60eae43ae4

View file

@ -1,5 +1,6 @@
from data.database import BUILD_PHASE from data.database import BUILD_PHASE
from data import model from data import model
import datetime
class StatusHandler(object): class StatusHandler(object):
""" Context wrapper for writing status to build logs. """ """ Context wrapper for writing status to build logs. """
@ -20,6 +21,8 @@ class StatusHandler(object):
self.__exit__(None, None, None) self.__exit__(None, None, None)
def _append_log_message(self, log_message, log_type=None, log_data=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) self._build_logs.append_log_message(self._uuid, log_message, log_type, log_data)
def append_log(self, log_message, extra_data=None): def append_log(self, log_message, extra_data=None):