Skip to content

Labels field is included twice in output #29

@tv42

Description

@tv42

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"}} 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions