func ProcessFunctionLog()

in logsapi/functionlogs.go [28:51]


func ProcessFunctionLog(
	requestID string,
	invokedFnArn string,
	log LogEvent,
) ([]byte, error) {
	lc := model.LogContainer{
		Log: &model.LogLine{
			Timestamp: model.Time(log.Time),
			Message:   log.StringRecord,
		},
	}

	lc.Log.FAAS = &model.FAAS{
		ID:        invokedFnArn,
		Execution: requestID,
	}

	var jsonWriter fastjson.Writer
	if err := lc.MarshalFastJSON(&jsonWriter); err != nil {
		return nil, err
	}

	return jsonWriter.Bytes(), nil
}