func parseLogsAPIPayload(data []byte) ([]LogMessage, error) {
	var messages []LogMessage
	if err := json.Unmarshal(data, &messages); err != nil {
		// Temporary fix to handle malformed JSON tracing object : retry with sanitization
		log.Debug("Can't read log message, retry with sanitization")
		sanitizedData := removeInvalidTracingItem(data)
		if err := json.Unmarshal(sanitizedData, &messages); err != nil {
			return nil, errors.New("can't read log message")
		}
		return messages, nil
	}
	return messages, nil
}
// parseLogsAPIPayload transforms the payload received from the Logs API to an array of LogMessage
parseLogsAPIPayload transforms the payload received from the Logs API to an array of LogMessage
// parseLogsAPIPayload transforms the payload received from the Logs API to an array of LogMessage
func parseLogsAPIPayload(data []byte) ([]LogMessage, error) {
	var messages []LogMessage
	if err := json.Unmarshal(data, &messages); err != nil {
		log.Debug("Can't read log message, retry with sanitization")
		sanitizedData := removeInvalidTracingItem(data)
		if err := json.Unmarshal(sanitizedData, &messages); err != nil {
			return nil, errors.New("can't read log message")
		}
		return messages, nil
	}
	return messages, nil
}
func parseLogsAPIPayload ( data [ ] byte ) ( [ ] LogMessage , error ) { var messages [ ] LogMessage if err := json . Unmarshal ( data , & messages ) ; err != nil { log . Debug ( " " ) sanitizedData := removeInvalidTracingItem ( data ) if err := json . Unmarshal ( sanitizedData , & messages ) ; err != nil { return nil , errors . New ( " " ) } return messages , nil } return messages , nil }
parseLogsAPIPayload transforms the payload received from the Logs API to an array of LogMessage
parseLogsAPIPayload transforms the payload received from the Logs API to an array of LogMessage
// Temporary fix to handle malformed JSON tracing object : retry with sanitization