Closed ttc0419 closed 4 months ago
There will be no output for the following code:
package main import ( "fmt" "github.com/rs/zerolog" "github.com/rs/zerolog/diode" "github.com/rs/zerolog/log" "os" ) func main() { log.Logger = zerolog.New( diode.NewWriter(os.Stderr, 1000, 0, func(missed int) { fmt.Printf("Dropped %d messages\n", missed) })) log.Info().Msg("Test") }
Okay, according to https://github.com/rs/zerolog/blob/eb081e1fa2325f7aab25a9386e463f67b37b421d/diode/diode_example_test.go#L20 You should close the writer before program exits.
There will be no output for the following code: