git/githistory: teach WithLogger and WithLoggerTo

This commit is contained in:
Taylor Blau 2017-08-29 17:04:18 -04:00
parent f7dd64e4eb
commit 3129b9a7a6

@ -127,11 +127,17 @@ var (
}
}
// WithLoggerto logs updates caused by the *git/githistory.Rewriter to
// the given io.Writer "sink".
WithLoggerTo = func(sink io.Writer) rewriterOption {
return WithLogger(log.NewLogger(sink))
}
// WithLogger logs updates caused by the *git/githistory.Rewriter to the
// given io.Writer "sink".
WithLogger = func(sink io.Writer) rewriterOption {
// be given to the provided logger, "l".
WithLogger = func(l *log.Logger) rewriterOption {
return func(r *Rewriter) {
r.l = log.NewLogger(sink)
r.l = l
}
}