2020-01-19 12:00:53 +00:00
|
|
|
package ldapserver
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io/ioutil"
|
|
|
|
"log"
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
|
|
|
var Logger logger
|
|
|
|
|
2020-01-26 18:47:38 +00:00
|
|
|
const DEBUG = false
|
2020-01-27 23:52:30 +00:00
|
|
|
const TRACE = false
|
2020-01-26 18:47:38 +00:00
|
|
|
|
2020-01-19 12:00:53 +00:00
|
|
|
// Logger represents log.Logger functions from the standard library
|
|
|
|
type logger interface {
|
|
|
|
Fatal(v ...interface{})
|
|
|
|
Fatalf(format string, v ...interface{})
|
|
|
|
Fatalln(v ...interface{})
|
|
|
|
|
|
|
|
Panic(v ...interface{})
|
|
|
|
Panicf(format string, v ...interface{})
|
|
|
|
Panicln(v ...interface{})
|
|
|
|
|
|
|
|
Print(v ...interface{})
|
|
|
|
Printf(format string, v ...interface{})
|
|
|
|
Println(v ...interface{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
Logger = log.New(os.Stdout, "", log.LstdFlags)
|
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
|
|
|
// DiscardingLogger can be used to disable logging output
|
|
|
|
DiscardingLogger = log.New(ioutil.Discard, "", 0)
|
|
|
|
)
|