(self)
return msg_text
Generate the event's body to send to Datadog.

        Consider `event_format` parameter:
        * Only use the specified list of event properties.
        * If unspecified, default to the EventLog's `Message` or `InsertionStrings`.
Generate the event's body to send to Datadog.
Generate the event s body to send to Datadog .
def _msg_text(self):
        """
        Generate the event's body to send to Datadog.

        Consider `event_format` parameter:
        * Only use the specified list of event properties.
        * If unspecified, default to the EventLog's `Message` or `InsertionStrings`.
        """
        msg_text = u""

        if self._format:
            msg_text_fields = ["%%%\n```"]

            for event_property in self._format:
                property_value = self.event.get(event_property)
                if property_value is None:
                    self.log.warning(u"Unrecognized `%s` event property.", event_property)
                    continue
                msg_text_fields.append(
                    u"{property_name}: {property_value}".format(
                        property_name=event_property, property_value=property_value
                    )
                )

            msg_text_fields.append("```\n%%%")

            msg_text = u"\n".join(msg_text_fields)
        else:
            # Override when verbosity
            if self.event.get('Message'):
                msg_text = u"{message}\n".format(message=self.event['Message'])
            elif self.event.get('InsertionStrings'):
                msg_text = u"\n".join([i_str for i_str in self.event['InsertionStrings'] if i_str.strip()])

        if self.notify_list:
            msg_text += u"\n{notify_list}".format(notify_list=' '.join([" @" + n for n in self.notify_list]))

        return msg_text
def _msg_text ( self ) : msg_text = u"" if self . _format : msg_text_fields = [ "%%%\n```" ] for event_property in self . _format : property_value = self . event . get ( event_property ) if property_value is None : self . log . warning ( u"Unrecognized `%s` event property." , event_property ) continue msg_text_fields . append ( u"{property_name}: {property_value}" . format ( property_name = event_property , property_value = property_value ) ) msg_text_fields . append ( "```\n%%%" ) msg_text = u"\n" . join ( msg_text_fields ) else : # Override when verbosity if self . event . get ( 'Message' ) : msg_text = u"{message}\n" . format ( message = self . event [ 'Message' ] ) elif self . event . get ( 'InsertionStrings' ) : msg_text = u"\n" . join ( [ i_str for i_str in self . event [ 'InsertionStrings' ] if i_str . strip ( ) ] ) if self . notify_list : msg_text += u"\n{notify_list}" . format ( notify_list = ' ' . join ( [ " @" + n for n in self . notify_list ] ) ) return msg_text