Example #1
0
    def emit(self, record):
        # NOTE: need to import this here otherwise it causes a circular reference
        #       i.e. settings imports loggers imports models imports settings...
        from bluebottle.payments_logger.models import PaymentLogEntry

        # TODO: we should use the formatting features of the logging library
        #       the format the message rather than doing it explicitly here.
        payment = record.args.get('payment')
        message = "{0} - {1}".format(payment, record.msg)

        log_entry = PaymentLogEntry(payment=payment, level=record.levelname, message=message)
        log_entry.save()

        return log_entry.pk
Example #2
0
 def _update_status(self, payment, order_id):
     status_log = PaymentLogEntry(payment=payment,
                                  level=PaymentLogLevels.info)
     status_log.message = 'Received status changed notification for merchant_order_reference {0}.'.format(
         order_id)
     status_log.save()
Example #3
0
 def _update_status(self, payment, order_id):
     status_log = PaymentLogEntry(payment=payment, level=PaymentLogLevels.info)
     status_log.message = 'Received status changed notification for merchant_order_reference {0}.'.format(order_id)
     status_log.save()