rs / zerolog

Zero Allocation JSON Logger
MIT License
10.33k stars 564 forks source link

ConsoleWriter uses the `level` field key to be invalid or panic? #664

Closed sishui closed 3 months ago

sishui commented 4 months ago
    l := zerolog.New(zerolog.ConsoleWriter{Out: os.Stdout}).
        With().
        Timestamp().
        Caller().
        Logger()
    l.Info().Str("level", "level-str").Msg("test string") // invalid, 
    //l.Debug().Int32("level", 9).Msg("test int32")  // panic
    //l.Debug().Int("level", 9).Msg("test int")  // panic
    l.Debug().Int64("level", 9).Msg("test int64") //panic
ndk commented 4 months ago

https://github.com/rs/zerolog/pull/665