matterbridge/vendor/github.com/shazow/ssh-chat/sshd/logger.go

23 lines
337 B
Go
Raw Normal View History

2017-12-02 16:24:05 -08:00
package sshd
import "io"
import stdlog "log"
var logger *stdlog.Logger
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{})
}