bine/tor/log.go

17 lines
385 B
Go
Raw Permalink Normal View History

2018-05-14 18:11:18 +00:00
package tor
import "fmt"
2018-05-14 20:18:32 +00:00
// DebugEnabled returns true if there is a DebugWriter.
2018-05-14 18:11:18 +00:00
func (t *Tor) DebugEnabled() bool {
return t.DebugWriter != nil
}
2018-05-14 20:36:29 +00:00
// Debugf writes the formatted string with a newline appended to the DebugWriter
// if present.
2018-05-14 18:11:18 +00:00
func (t *Tor) Debugf(format string, args ...interface{}) {
if w := t.DebugWriter; w != nil {
fmt.Fprintf(w, format+"\n", args...)
}
}