From e1f5c31402df97594116267b4f918582f2496ee0 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 28 Jan 2020 00:52:30 +0100 Subject: More logs --- ldapserver/client.go | 10 ++++++---- ldapserver/logger.go | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'ldapserver') 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 { -- cgit v1.2.3