You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
547 B
31 lines
547 B
8 years ago
|
package ldap
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
|
||
4 years ago
|
ber "github.com/go-asn1-ber/asn1-ber"
|
||
8 years ago
|
)
|
||
|
|
||
6 years ago
|
// debugging type
|
||
8 years ago
|
// - has a Printf method to write the debug output
|
||
|
type debugging bool
|
||
|
|
||
4 years ago
|
// Enable controls debugging mode.
|
||
|
func (debug *debugging) Enable(b bool) {
|
||
|
*debug = debugging(b)
|
||
|
}
|
||
|
|
||
|
// Printf writes debug output.
|
||
8 years ago
|
func (debug debugging) Printf(format string, args ...interface{}) {
|
||
|
if debug {
|
||
|
log.Printf(format, args...)
|
||
|
}
|
||
|
}
|
||
|
|
||
4 years ago
|
// PrintPacket dumps a packet.
|
||
8 years ago
|
func (debug debugging) PrintPacket(packet *ber.Packet) {
|
||
|
if debug {
|
||
|
ber.PrintPacket(packet)
|
||
|
}
|
||
|
}
|