Added an informational log message for consumer start

This commit is contained in:
Daniel Quinn
2016-03-06 17:26:07 +00:00
parent 2fba41ad75
commit 3b278c3a24
3 changed files with 25 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
import logging
import os
import re
import uuid
from django.conf import settings
from django.core.urlresolvers import reverse
@@ -236,3 +237,16 @@ class Log(models.Model):
def __str__(self):
return self.message
def save(self, *args, **kwargs):
"""
To allow for the case where we don't want to group the message, we
shouldn't force the caller to specify a one-time group value. However,
allowing group=None means that the manager can't differentiate the
different un-grouped messages, so instead we set a random one here.
"""
if not self.group:
self.group = uuid.uuid4()
models.Model.save(self, *args, **kwargs)