debug.go 409 B

123456789101112131415161718192021222324
  1. package ldap
  2. import (
  3. "log"
  4. "github.com/gogits/gogs/modules/asn1-ber"
  5. )
  6. // debugging 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. }