github.com/hellobchain/third_party@v0.0.0-20230331131523-deb0478a2e52/ldap.v2/debug.go (about) 1 package ldap 2 3 import ( 4 "log" 5 6 "gopkg.in/asn1-ber.v1" 7 ) 8 9 // debbuging type 10 // - has a Printf method to write the debug output 11 type debugging bool 12 13 // write debug output 14 func (debug debugging) Printf(format string, args ...interface{}) { 15 if debug { 16 log.Printf(format, args...) 17 } 18 } 19 20 func (debug debugging) PrintPacket(packet *ber.Packet) { 21 if debug { 22 ber.PrintPacket(packet) 23 } 24 }