new logging package, just the essentials

This commit is contained in:
Colin Henry 2020-08-22 15:47:37 -07:00
parent 284c8f8359
commit ed136ca83e

15
log/logger.go Normal file
View File

@ -0,0 +1,15 @@
package log
// Logger is a loggin interface with only the essentials that a function that needs to log should care about. Compatible with standard Go logger.
type Logger interface {
Print(v ...interface{})
Printf(format string, v ...interface{})
Println(v ...interface{})
}
// None provides a logger that doesnt log anything
type None struct{}
func (n None) Print(v ...interface{}) {}
func (n None) Printf(format string, v ...interface{}) {}
func (n None) Println(v ...interface{}) {}