summaryrefslogtreecommitdiff
path: root/debugoff.go
diff options
context:
space:
mode:
authorAdam Scarr <adam@vektah.net>2017-08-10 21:04:14 +1000
committerAdam Scarr <adam@vektah.net>2017-08-10 21:08:18 +1000
commitaf542eff9e1e51561a9efa37685ee07b1d01b53e (patch)
treec700bdca58b4f9bbeb89ba1b102b2a779c88f7f3 /debugoff.go
parentb64fcfaa6115eb4a5f65c12d37f95d842136ae35 (diff)
Add parse logging
Diffstat (limited to 'debugoff.go')
-rw-r--r--debugoff.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/debugoff.go b/debugoff.go
index ba0ef33..7afcce6 100644
--- a/debugoff.go
+++ b/debugoff.go
@@ -2,6 +2,8 @@
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.
@@ -11,3 +13,9 @@ func NewParser(description string, p Parser) Parser {
// 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() {}