Skip to content

Commit 9c0b490

Browse files
committed
switch OpbeatExtra to interface{} values to avoid type conversion
1 parent d42b7af commit 9c0b490

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

logbeat.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
)
66

77
// LogbeatVersion is used to identify notifications sent by Logbeat.
8-
const LogbeatVersion string = "0.0.1"
8+
const LogbeatVersion string = "0.0.2"
99

1010
// LogbeatHook delivers logs to the Opbeat service.
1111
type LogbeatHook struct {

opbeat.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type OpbeatPayload struct {
3333
}
3434

3535
// OpbeatExtra structures Logrus Fields for for Opbeat's API.
36-
type OpbeatExtra map[string]string
36+
type OpbeatExtra map[string]interface{}
3737

3838
// NewOpbeatClient returns an OpbeatClient used for commnicating with Opbeat's API.
3939
func NewOpbeatClient(org, app, token string) *OpbeatClient {
@@ -58,7 +58,7 @@ func NewOpbeatClient(org, app, token string) *OpbeatClient {
5858
func NewOpbeatPayload(entry *logrus.Entry) *OpbeatPayload {
5959
var extra = OpbeatExtra{}
6060
for k, v := range entry.Data {
61-
extra[k] = v.(string)
61+
extra[k] = v
6262
}
6363

6464
hostname, _ := os.Hostname()

0 commit comments

Comments
 (0)