Example #1
0
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
}
Example #2
0
func register() {
	protolog.SetLogger(protolog.NewLogger(newPusher(globalMarshaller, globalLogDebug), globalLoggerOptions))
}
Example #3
0
func register() {
	protolog.SetLogger(protolog.NewLogger(NewPusher(globalPusherOptions), globalLoggerOptions))
}