Files
remark42/backend/vendor/github.com/go-pkgz/auth/logger/interface.go
T
Umputun c5b927904f extend User struct with site_id/aud
updated to 0.8.0 of auth pkgs supporting user-space aud
2019-08-23 03:12:08 -05:00

23 lines
775 B
Go

// Package logger defines interface for logging. Implementation should be passed by user.
// Also provides NoOp (do-nothing) and Std (redirect to std log) predefined loggers.
package logger
import "log"
// L defined logger interface used everywhere in the package
type L interface {
Logf(format string, args ...interface{})
}
// Func type is an adapter to allow the use of ordinary functions as Logger.
type Func func(format string, args ...interface{})
// Logf calls f(id)
func (f Func) Logf(format string, args ...interface{}) { f(format, args...) }
// NoOp logger
var NoOp = Func(func(format string, args ...interface{}) {})
// Std logger sends to std default logger directly
var Std = Func(func(format string, args ...interface{}) { log.Printf(format, args...) })