Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Adjust deprecation path logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bhs committed Sep 26, 2016
1 parent e4a87f0 commit fefab04
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions span.go
Expand Up @@ -160,11 +160,18 @@ type LogData struct {

// ToLogRecord converts a deprecated LogData to a non-deprecated LogRecord
func (ld *LogData) ToLogRecord() LogRecord {
return LogRecord{
rval := LogRecord{
Timestamp: ld.Timestamp,
Fields: []log.Field{
}
if ld.Payload == nil {
rval.Fields = []log.Field{
log.String("event", ld.Event),
}
} else {
rval.Fields = []log.Field{
log.String("event", ld.Event),
log.Object("payload", ld.Payload),
},
}
}
return rval
}

0 comments on commit fefab04

Please sign in to comment.