code: def pretty_format(message):
      
      skip = {
          TIMESTAMP_FIELD, TASK_UUID_FIELD, TASK_LEVEL_FIELD, MESSAGE_TYPE_FIELD,
          ACTION_TYPE_FIELD, ACTION_STATUS_FIELD}
  
      def add_field(previous, key, value):
          value = unicode(pprint.pformat(value, width=40)).replace(
              "\\n", "\n ").replace("\\t", "\t")
          # Reindent second line and later to match up with first line's
          # indentation:
          lines = value.split("\n")
          # indent lines are "  <key length>|  <value>"
          indent = "{}| ".format(" " * (2 + len(key)))
          value = "\n".join([lines[0]] + [indent + l for l in lines[1:]])
          return "  %s: %s\n" % (key, value)
  
      remaining = ""
      for field in [ACTION_TYPE_FIELD, MESSAGE_TYPE_FIELD, ACTION_STATUS_FIELD]:
          if field in message:
              remaining += add_field(remaining, field, message[field])
      for (key, value) in sorted(message.items()):
          if key not in skip:
              remaining += add_field(remaining, key, value)
  
      level = "/" + "/".join(map(unicode, message[TASK_LEVEL_FIELD]))
      return "%s -> %s\n%sZ\n%s" % (
          message[TASK_UUID_FIELD],
          level,
          # If we were returning or storing the datetime we'd want to use an
          # explicit timezone instead of a naive datetime, but since we're
          # just using it for formatting we needn't bother.
          datetime.utcfromtimestamp(message[TIMESTAMP_FIELD]).isoformat(
              sep=str(" ")),
          remaining, )
docs: Convert a message dictionary into a human-readable string.
  
      @param message: Message to parse, as dictionary.
  
      @return: Unicode string.