From e45f83457931e08f9f6d5aec48f51fd390a01eb8 Mon Sep 17 00:00:00 2001 From: tmfkams Date: Sun, 19 Jan 2014 23:04:16 +0100 Subject: refactoring, fixes for go1.2, modify added --- debugging.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 debugging.go (limited to 'debugging.go') diff --git a/debugging.go b/debugging.go new file mode 100644 index 0000000..cefbfad --- /dev/null +++ b/debugging.go @@ -0,0 +1,31 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// File contains debugging functionality +package ldap + +import ( + "github.com/tmfkams/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 { + // TODO: DEBUG prefix + log.Printf(format, args...) + } +} + +func (debug debugging) PrintPacket(packet *ber.Packet) { + if debug { + ber.PrintPacket(packet) + } +} -- cgit v1.2.3