castor/logger.go

31 lines
454 B
Go

package main
import "log"
// Logger has just two levels: info and debug
type Logger interface {
Info(...interface{})
Debug(...interface{})
}
// NewLogger returns a logger that has just two levels: info and debug
func NewLogger(debug bool) Logger {
return &l{
debug: debug,
}
}
type l struct {
debug bool
}
func (l *l) Info(s ...interface{}) {
log.Println(s...)
}
func (l *l) Debug(s ...interface{}) {
if l.debug {
log.Println(s...)
}
}