~egtann/sjs

sjs/logger.go -rw-r--r-- 235 bytes
c9f368d1 — Evan Tann adopt go1.13 stdlib errors 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package sjs

type Logger interface {
	Printf(s string, args ...interface{})
}

type OptLogger struct{ Log Logger }

func (o *OptLogger) Printf(s string, args ...interface{}) {
	if o.Log == nil {
		return
	}
	o.Log.Printf(s, args...)
}