Skip to content

Commit

Permalink
Fix context event.eventParams
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianpozueco committed Jul 8, 2021
1 parent 78c59b7 commit e0f2fe3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion logger/logger.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package logger

import (
"encoding/json"
"github.com/Ryanair/gofrlib/log"
"github.com/aws/aws-lambda-go/events"
)
Expand Down Expand Up @@ -69,7 +70,9 @@ func SetEvent(source string, body string, params map[string]string) {
func SetSQSEvent(event events.SQSMessage) {
log.With("Body.context.origin.event.eventSource", event.EventSource)
log.With("Body.context.origin.event.eventBody", event.Body)
log.With("Body.context.origin.event.eventParams", event.Attributes)

raw, _ := json.Marshal(event.Attributes)
log.With("Body.context.origin.event.eventParams", string(raw))
}

func SetApigwRequest(event events.APIGatewayV2HTTPRequest) {
Expand Down

0 comments on commit e0f2fe3

Please sign in to comment.