aboutsummaryrefslogblamecommitdiff
path: root/ldapserver/logger.go
blob: 9f145cfc56c1ba1516ea4e019ff1b2770293c19f (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                   
                   
                   
 






















                                                                   
package ldapserver

import (
	"io/ioutil"
	"log"
	"os"
)

var Logger logger

const DEBUG = false
const TRACE = false

// 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)
)