summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/shazow/ssh-chat/sshd/logger.go
blob: c4ebc04c952adc0dffdca25f2d181946fb1f748b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package sshd

import "io"
import stdlog "log"

var logger *stdlog.Logger

// SetLogger sets the package logging output to use w.
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{})
}