debug.go 390 B

12345678910111213141516171819202122232425
  1. package ldap
  2. import (
  3. "log"
  4. "gopkg.in/asn1-ber.v1"
  5. )
  6. // debbuging type
  7. // - has a Printf method to write the debug output
  8. type debugging bool
  9. // write debug output
  10. func (debug debugging) Printf(format string, args ...interface{}) {
  11. if debug {
  12. log.Printf(format, args...)
  13. }
  14. }
  15. func (debug debugging) PrintPacket(packet *ber.Packet) {
  16. if debug {
  17. ber.PrintPacket(packet)
  18. }
  19. }