1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 22:59:43 +02:00
documize/vendor/gopkg.in/ldap.v3/debug.go

31 lines
536 B
Go
Raw Normal View History

2018-08-28 10:19:22 +01:00
package ldap
import (
"log"
ber "gopkg.in/asn1-ber.v1"
2018-08-28 10:19:22 +01:00
)
// debugging type
// - has a Printf method to write the debug output
type debugging bool
// Enable controls debugging mode.
func (debug *debugging) Enable(b bool) {
*debug = debugging(b)
}
// Printf writes debug output.
2018-08-28 10:19:22 +01:00
func (debug debugging) Printf(format string, args ...interface{}) {
if debug {
log.Printf(format, args...)
}
}
// PrintPacket dumps a packet.
2018-08-28 10:19:22 +01:00
func (debug debugging) PrintPacket(packet *ber.Packet) {
if debug {
ber.PrintPacket(packet)
}
}