Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

set breadcrumb type and timestamp from event #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
18 changes: 14 additions & 4 deletions writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,21 @@ func (w *Writer) addBreadcrumb(event *sentry.Event) {
}
}

var breadcrumbType string
switch event.Level {
case sentry.LevelFatal, sentry.LevelError:
breadcrumbType = "error"
default:
breadcrumbType = "default"
}

w.hub.AddBreadcrumb(&sentry.Breadcrumb{
Category: category,
Message: event.Message,
Level: event.Level,
Data: event.Extra,
Type: breadcrumbType,
Category: category,
Message: event.Message,
Level: event.Level,
Data: event.Extra,
Timestamp: event.Timestamp,
}, nil)
}

Expand Down
Loading