We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal reproduction:
package main import ( "fmt" "time" "github.com/rs/zerolog" "github.com/rs/zerolog/diode" ) type SlowWriter struct{} func (rw *SlowWriter) Write(p []byte) (n int, err error) { time.Sleep(200 * time.Millisecond) // emulate slow operation fmt.Println(string(p)) return len(p), nil } func main() { zerolog.TimeFieldFormat = "2006-01-02 15:04:05.999 Z07" slowWriter := SlowWriter{} diodeWriter := diode.NewWriter(&slowWriter, 500, 0, func(missed int) { fmt.Printf("Missed %d logs\n", missed) }) leveledDiodeWriter := zerolog.LevelWriterAdapter{ Writer: &diodeWriter, } filteredDiodeWriter := zerolog.FilteredLevelWriter{ Writer: &leveledDiodeWriter, Level: zerolog.InfoLevel, } logger := zerolog.New(&filteredDiodeWriter).With().Timestamp().Logger() logger.Trace().Msg("Hello Trace World") logger.Debug().Msg("Hello Debug World") logger.Info().Msg("Hello Info World") logger.Warn().Msg("Hello Warn World") logger.Error().Msg("Hello Error World") logger.Fatal().Msg("Hello Fatal World") }
It outputs just
exit status 1
without any logs in the console
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Minimal reproduction:
It outputs just
without any logs in the console
The text was updated successfully, but these errors were encountered: