2017-12-03 00:24:05 +00:00
|
|
|
package sshd
|
|
|
|
|
|
|
|
import "io"
|
|
|
|
import stdlog "log"
|
|
|
|
|
|
|
|
var logger *stdlog.Logger
|
|
|
|
|
2019-11-17 20:42:41 +00:00
|
|
|
// SetLogger sets the package logging output to use w.
|
2017-12-03 00:24:05 +00:00
|
|
|
func SetLogger(w io.Writer) {
|
|
|
|
flags := stdlog.Flags()
|
|
|
|
prefix := "[sshd] "
|
|
|
|
logger = stdlog.New(w, prefix, flags)
|
|
|
|
}
|
|
|
|
|
|
|
|
type nullWriter struct{}
|
|
|
|
|
|
|
|
func (nullWriter) Write(data []byte) (int, error) {
|
|
|
|
return len(data), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
SetLogger(nullWriter{})
|
|
|
|
}
|