zrepl/logger/stderrlogger.go

24 lines
381 B
Go
Raw Normal View History

package logger
import (
"fmt"
"os"
)
2019-03-22 19:41:12 +01:00
type stderrLoggerOutlet struct{}
func (stderrLoggerOutlet) WriteEntry(entry Entry) error {
fmt.Fprintf(os.Stderr, "%#v\n", entry)
return nil
}
var _ Logger = testLogger{}
func NewStderrDebugLogger() Logger {
outlets := NewOutlets()
outlets.Add(&stderrLoggerOutlet{}, Debug)
return &testLogger{
Logger: NewLogger(outlets, 0),
}
}