diff options
Diffstat (limited to 'vendor/github.com/getsentry/raven-go/writer.go')
-rw-r--r-- | vendor/github.com/getsentry/raven-go/writer.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/github.com/getsentry/raven-go/writer.go b/vendor/github.com/getsentry/raven-go/writer.go new file mode 100644 index 000000000..61f7a9108 --- /dev/null +++ b/vendor/github.com/getsentry/raven-go/writer.go @@ -0,0 +1,20 @@ +package raven + +type Writer struct { + Client *Client + Level Severity + Logger string // Logger name reported to Sentry +} + +// Write formats the byte slice p into a string, and sends a message to +// Sentry at the severity level indicated by the Writer w. +func (w *Writer) Write(p []byte) (int, error) { + message := string(p) + + packet := NewPacket(message, &Message{message, nil}) + packet.Level = w.Level + packet.Logger = w.Logger + w.Client.Capture(packet, nil) + + return len(p), nil +} |