mini_buildd.models.msglog module¶
Message log: Logs that should also go to the end user.
An instance of MsgLog may replace the standard (python) log; logs will also go to the django messaging system, and it also stores the logs so they might used for other (non-django) uses.
Logs done via MsgLog (aka “messages”) are intended for the end user, to be shown in an UI (for us, the django web app or the command line client).
Log coding idioms to be used:
# Optional: Alias for MsgLog class in modules where we need it
from mini_buildd.models.msglog import MsgLog
# Always: Global standard LOG object, directly after imports)
LOG = logging.getLogger(__name__)
# Standard log
LOG.info("blah blah")
# Message log
MsgLog(LOG, request).info("Dear user: blah blah")