Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package logrus_sentry
import (
"encoding/json"
"fmt"
"reflect"
"runtime"
"sync"
"time"
Expand Down Expand Up @@ -393,6 +394,15 @@ func (hook *SentryHook) formatExtraData(df *dataField) (result map[string]interf

// formatData returns value as a suitable format.
func formatData(value interface{}) (formatted interface{}) {
if value == nil {
valueType := reflect.TypeOf(value)
if valueType == nil {
return "nil"
}

return "nil " + valueType.String()
}

switch value := value.(type) {
case json.Marshaler:
return value
Expand Down