zapdriver
zapdriver copied to clipboard
Labels field is included twice in output
logging.googleapis.com/labels
gets included twice, once with the intended content and again as an empty object.
"logging.googleapis.com/labels":{"hello":"world","hi":"universe"},"logging.googleapis.com/labels":{},
$ cat go.mod
module example.com/m
go 1.14
require github.com/blendle/zapdriver v1.3.1
$ cat main.go
package main
import (
"log"
"github.com/blendle/zapdriver"
)
func main() {
logger, err := zapdriver.NewProduction()
if err != nil {
log.Fatal(err)
}
logger.Info(
"Did something.",
zapdriver.Labels(
zapdriver.Label("hello", "world"),
zapdriver.Label("hi", "universe"),
),
)
}
$ go run .
{"severity":"INFO","timestamp":"2020-05-12T15:15:43.21090722-06:00","caller":"z/main.go:14","message":"Did something.","logging.googleapis.com/labels":{"hello":"world","hi":"universe"},"logging.googleapis.com/labels":{},"logging.googleapis.com/sourceLocation":{"file":"/home/tv/z/main.go","line":"14","function":"main.main"}}
Thanks for the report @tv42, good catch!
I've provided a fix in #30. Unfortunately I no longer have the commit bit for this repo, but I'm sure someone from Blendle will merge that PR soon and add a new tagged release 😄
Any update on this? Looks like the PR still hasn't been merged 😢