Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labels field is included twice in output #29

Open
tv42 opened this issue May 12, 2020 · 2 comments · May be fixed by #30
Open

Labels field is included twice in output #29

tv42 opened this issue May 12, 2020 · 2 comments · May be fixed by #30

Comments

@tv42
Copy link

tv42 commented May 12, 2020

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"}} 
@JeanMertz JeanMertz linked a pull request May 13, 2020 that will close this issue
@JeanMertz
Copy link
Contributor

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 😄

@jordanpotter
Copy link

Any update on this? Looks like the PR still hasn't been merged 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants