goparsify/debugoff.go

22 lines
694 B
Go
Raw Normal View History

2017-08-07 12:07:29 +02:00
// +build !debug
package goparsify
2017-08-10 13:04:14 +02:00
import "io"
2017-08-09 13:18:14 +02:00
// NewParser should be called around the creation of every Parser.
// It does nothing normally and should incur no runtime overhead, but when building with -tags debug
// it will instrument every parser to collect valuable timing information displayable with DumpDebugStats.
2017-08-07 12:07:29 +02:00
func NewParser(description string, p Parser) Parser {
return p
}
2017-08-09 13:18:14 +02:00
// DumpDebugStats will print out the curring timings for each parser if built with -tags debug
func DumpDebugStats() {}
2017-08-10 13:04:14 +02:00
// EnableLogging will write logs to the given writer as the next parse happens
func EnableLogging(w io.Writer) {}
// DisableLogging will stop writing logs
func DisableLogging() {}