func setupLoggerText(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{ Marshaller: protolog.NewTextMarshaller(protolog.MarshallerOptions{}), }, ), protolog.LoggerOptions{}, ).AtLevel(protolog.Level_LEVEL_INFO) return tempDir, file, logger }
/* Package syslog defines functionality for integration with syslog. */ package syslog import ( "log/syslog" "go.pedge.io/protolog" ) var ( globalMarshaller = protolog.NewTextMarshaller( protolog.MarshallerOptions{ DisableTimestamp: true, DisableLevel: true, }, ) ) // PusherOptions defines options for constructing a new syslog protolog.Pusher. type PusherOptions struct { Marshaller protolog.Marshaller } // NewPusher creates a new protolog.Pusher that logs using syslog. func NewPusher(writer *syslog.Writer, options PusherOptions) protolog.Pusher { return newPusher(writer, options) }