diff options
author | Alex Auvolat <alex@adnab.me> | 2020-01-19 13:00:53 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-01-19 13:00:53 +0100 |
commit | 67fa504e20095d9acd5537b46f604ce8baa4e44a (patch) | |
tree | dcbe95bfdcd71a2d0307ea7214017c3632f44f8f /ldapserver/logger.go | |
parent | bade33cf1529893a92a283f6dc86e73f8766049e (diff) | |
download | bottin-67fa504e20095d9acd5537b46f604ce8baa4e44a.tar.gz bottin-67fa504e20095d9acd5537b46f604ce8baa4e44a.zip |
Add ldapserver source in here & add support for client state
Diffstat (limited to 'ldapserver/logger.go')
-rw-r--r-- | ldapserver/logger.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ldapserver/logger.go b/ldapserver/logger.go new file mode 100644 index 0000000..fdac2f4 --- /dev/null +++ b/ldapserver/logger.go @@ -0,0 +1,33 @@ +package ldapserver + +import ( + "io/ioutil" + "log" + "os" +) + +var Logger logger + +// 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) +) |