From 3bda2b4e55f7ff8ac8bba30e0d0c606ab11ffc7e Mon Sep 17 00:00:00 2001 From: Marc Sauter Date: Tue, 4 Feb 2014 23:04:24 +0100 Subject: connection handling --- debug.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 debug.go (limited to 'debug.go') diff --git a/debug.go b/debug.go new file mode 100644 index 0000000..56ed96f --- /dev/null +++ b/debug.go @@ -0,0 +1,24 @@ +// File contains debugging functionality +package ldap + +import ( + "github.com/marcsauter/asn1-ber" + "log" +) + +// debbuging type +// - has a Printf method to write the debug output +type debugging bool + +// write debug output +func (debug debugging) Printf(format string, args ...interface{}) { + if debug { + log.Printf(format, args...) + } +} + +func (debug debugging) PrintPacket(packet *ber.Packet) { + if debug { + ber.PrintPacket(packet) + } +} -- cgit v1.2.3