mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-29 03:45:27 +01:00
28 lines
420 B
Go
28 lines
420 B
Go
|
package logger
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
type stderrLogger struct {
|
||
|
Logger
|
||
|
}
|
||
|
|
||
|
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),
|
||
|
}
|
||
|
}
|