def action_logging(user, object_list, action_type, message=None, context=None):
    """
    Add ActionLog using a set of parameters.

    user:
      The user that did the action.
    object_list:
      A list of objects that should be created the actionlog for.
    action_type:
      Label of a type of action from the NoticeType model.
    message:
      A message to be included at the actionlog. If no message is passed
      it will try do render a message using the notice.html from the
      notification application.
    context:
      To render the message using the notification files, sometimes it is
      necessary to pass some vars by using a context.

    Usage::

        al = 'project_added'
        context = {'project': object}
        action_logging(request.user, [object], al , context=context):
    """
    if not getattr(settings, 'ACTIONLOG_ENABLED', None):
        return

    if context is None:
        context = {}

    if message is None:
        message = _get_formatted_message(action_type, context)

    action_type_obj = NoticeType.objects.get(label=action_type)

    time = datetime.datetime.now()

    try:
        for object in object_list:
            l = LogEntry(
                    user_id = user.pk,
                    content_type = ContentType.objects.get_for_model(object),
                    object_id = object.pk,
                    object_name = force_unicode(object)[:200],
                    action_type = action_type_obj,
                    action_time = time,
                    message = message)
            l.save()
            if USE_REDIS:
                _log_to_queues(object, user.pk, time, message)
    except __HOLE__:
        raise TypeError("The 'object_list' parameter must be iterable")
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/actionlog/models.py/action_logging