INNER CODE UNIT · Go

NewCreatorLoggingMiddleware

prometheus-msteams/prometheus-msteams · pkg/card/converter.go:68

func NewCreatorLoggingMiddleware(l log.Logger, n Converter) Converter {
	return loggingMiddleware{l, n}
}

func (l loggingMiddleware) Convert(ctx context.Context, a webhook.Message) (c Office365ConnectorCard, err error) {
	defer func(begin time.Time) {
		if len(c.PotentialAction) > 5 {
			l.logger.Log(
				"warning", "There can only be a maximum of 5 actions in a potentialAction collection",
				"actions", c.PotentialAction,
			)
		}

		for _, s := range c.Sections {
			if len(s.PotentialAction) > 5 {
				l.logger.Log(
					"warning", "There can only be a maximum of 5 actions in a potentialAction collection",
					"actions", s.PotentialAction,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…