rs / zerolog

Zero Allocation JSON Logger
MIT License
10.39k stars 566 forks source link

log.Fatal() not printing anything #622

Closed 1366613 closed 6 months ago

1366613 commented 9 months ago

I'm not sure what's wrong with this code.

package main

import (
    "fmt"
    "github.com/rs/zerolog"
    "github.com/rs/zerolog/diode"
    "os"
    "time"
)

func main() {
    wr := diode.NewWriter(os.Stdout, 1000, 10*time.Millisecond, func(missed int) {
        fmt.Printf("Logger Dropped %d messages", missed)
    })
    log := zerolog.New(wr).With().Caller().Timestamp().Logger()
    log.Fatal().Msg("test")
    time.Sleep(10 * time.Second)
}
gmbuell commented 8 months ago

Fixed in #634