Open luisdavim opened 6 months ago
Currently fields doesn't support map[string]string.
map[string]string
Example:
package main import ( "os" "github.com/rs/zerolog" ) func main() { fields := map[string]string{ "bar": "baz", "n": "1", } log := zerolog.New(os.Stdout) log.Log(). Str("foo", "bar"). Fields(fields). Msg("hello world") }
results in:
{"foo":"bar","message":"hello world"}
whilst:
package main import ( "os" "github.com/rs/zerolog" ) func main() { fields := map[string]interface{}{ "bar": "baz", "n": "1", } log := zerolog.New(os.Stdout) log.Log(). Str("foo", "bar"). Fields(fields). Msg("hello world") }
outputs:
{"foo":"bar","bar":"baz","n":"1","message":"hello world"}
Currently fields doesn't support
map[string]string
.Example:
results in:
whilst:
outputs: