aboutsummaryrefslogtreecommitdiff
path: root/ldapserver
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-01-28 00:52:30 +0100
committerAlex Auvolat <alex@adnab.me>2020-01-28 00:52:30 +0100
commite1f5c31402df97594116267b4f918582f2496ee0 (patch)
treecf87b238f6680ea85ffa8d9d6c5107b096ff5056 /ldapserver
parent3edaad9317db280db903a18ec85a70e6c32cabf9 (diff)
downloadbottin-e1f5c31402df97594116267b4f918582f2496ee0.tar.gz
bottin-e1f5c31402df97594116267b4f918582f2496ee0.zip
More logs
Diffstat (limited to 'ldapserver')
-rw-r--r--ldapserver/client.go10
-rw-r--r--ldapserver/logger.go1
2 files changed, 7 insertions, 4 deletions
diff --git a/ldapserver/client.go b/ldapserver/client.go
index 085041f..681aa76 100644
--- a/ldapserver/client.go
+++ b/ldapserver/client.go
@@ -134,8 +134,9 @@ func (c *client) serve() {
Logger.Printf("Error reading Message : %s\n\t%x", err.Error(), messagePacket.bytes)
continue
}
- if DEBUG {
- Logger.Printf("<<< %d - %s - hex=%x", c.Numero, message.ProtocolOpName(), messagePacket)
+ if TRACE {
+ //Logger.Printf("<<< %d - %s - hex=%x", c.Numero, message.ProtocolOpName(), messagePacket)
+ Logger.Printf("<<< %d - %#v", c.Numero, message)
}
// TODO: Use a implementation to limit runnuning request by client
@@ -211,8 +212,9 @@ func (c *client) close() {
func (c *client) writeMessage(m *ldap.LDAPMessage) {
data, _ := m.Write()
- if DEBUG {
- Logger.Printf(">>> %d - %s - hex=%x", c.Numero, m.ProtocolOpName(), data.Bytes())
+ if TRACE {
+ //Logger.Printf(">>> %d - %s - hex=%x", c.Numero, m.ProtocolOpName(), data.Bytes())
+ Logger.Printf(">>> %d - %#v", c.Numero, m)
}
c.bw.Write(data.Bytes())
c.bw.Flush()
diff --git a/ldapserver/logger.go b/ldapserver/logger.go
index 70352e3..9f145cf 100644
--- a/ldapserver/logger.go
+++ b/ldapserver/logger.go
@@ -9,6 +9,7 @@ import (
var Logger logger
const DEBUG = false
+const TRACE = false
// Logger represents log.Logger functions from the standard library
type logger interface {