aboutsummaryrefslogtreecommitdiff
path: root/ldapserver/logger.go
diff options
context:
space:
mode:
Diffstat (limited to 'ldapserver/logger.go')
-rw-r--r--ldapserver/logger.go32
1 files changed, 7 insertions, 25 deletions
diff --git a/ldapserver/logger.go b/ldapserver/logger.go
index 9f145cf..9286956 100644
--- a/ldapserver/logger.go
+++ b/ldapserver/logger.go
@@ -1,36 +1,18 @@
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{})
+ log "github.com/sirupsen/logrus"
+)
- Panic(v ...interface{})
- Panicf(format string, v ...interface{})
- Panicln(v ...interface{})
+var Logger *log.Logger
- Print(v ...interface{})
- Printf(format string, v ...interface{})
- Println(v ...interface{})
-}
func init() {
- Logger = log.New(os.Stdout, "", log.LstdFlags)
+ Logger = log.New()
+ Logger.SetOutput(os.Stdout)
+ Logger.SetFormatter(&log.TextFormatter{})
+ Logger.SetLevel(log.InfoLevel)
}
-var (
- // DiscardingLogger can be used to disable logging output
- DiscardingLogger = log.New(ioutil.Discard, "", 0)
-)