import logging from data import model from data.logs_model.table_logs_model import TableLogsModel from data.logs_model.document_logs_model import DocumentLogsModel logger = logging.getLogger(__name__) class TableDocumentTransitionLogsModel(TableLogsModel): """ TableDocumentTransitionLogsModel implements the data model that logs to both a database table and document store, but reads exclusively from the database tables. This implementation is part of the migration path to move the logs from the database. """ def __init__(self, **kwargs): super(TableDocumentTransitionLogsModel, self).__init__() self.document_logs_model = DocumentLogsModel(**kwargs) def log_action(self, kind_name, namespace_name=None, performer=None, ip=None, metadata=None, repository=None, repository_name=None, timestamp=None): super(TableDocumentTransitionLogsModel, self).log_action(kind_name, namespace_name, performer=performer, repository=repository, repository_name=repository_name, ip=ip, metadata=metadata, timestamp=timestamp) self.document_logs_model.log_action(kind_name, namespace_name, performer=performer, repository=repository, repository_name=repository_name, ip=ip, metadata=metadata, timestamp=timestamp)