forked from vektah/goparsify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebugoff.go
More file actions
21 lines (15 loc) · 694 Bytes
/
debugoff.go
File metadata and controls
21 lines (15 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// +build !debug
package goparsify
import "io"
// 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.
func NewParser(description string, p Parser) Parser {
return p
}
// DumpDebugStats will print out the curring timings for each parser if built with -tags debug
func DumpDebugStats() {}
// 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() {}