func setupLogger(b *testing.B) (string, *os.File, protolog.Logger) { tempDir, err := ioutil.TempDir("", "protolog") require.NoError(b, err) file, err := os.Create(filepath.Join(tempDir, "log.out")) require.NoError(b, err) logger := protolog.NewLogger( protolog.NewWritePusher( protolog.NewFileFlusher(file), protolog.WritePusherOptions{}, ), protolog.LoggerOptions{}, ).AtLevel(protolog.Level_LEVEL_INFO) return tempDir, file, logger }
func register() { protolog.SetLogger(protolog.NewLogger(newPusher(globalMarshaller, globalLogDebug), globalLoggerOptions)) }
func register() { protolog.SetLogger(protolog.NewLogger(NewPusher(globalPusherOptions), globalLoggerOptions)) }