code: def WriteEventBody(self, event):
      
      inode = getattr(event, 'inode', None)
      if inode is None:
        event.inode = 0
  
      try:
        message, _ = self._output_mediator.GetFormattedMessages(event)
      except errors.WrongFormatter:
        message = None
  
      if message:
        event.message = message
  
      json_dict = self._JSON_SERIALIZER.WriteSerializedDict(event)
      json_string = json.dumps(json_dict, sort_keys=True)
      # dumps() returns an ascii-encoded byte string in Python 2.
      if py2to3.PY_2:
        json_string = codecs.decode(json_string, 'ascii')
      self._output_writer.Write(json_string)
      self._output_writer.Write('\n')
docs: Writes the body of an event object to the output.
  
      Args:
        event (EventObject): event.