diff --git a/org/document.go b/org/document.go index a7eb2b6..8158e25 100644 --- a/org/document.go +++ b/org/document.go @@ -19,6 +19,7 @@ type Document struct { BufferSettings map[string]string DefaultSettings map[string]string Error error + Debug bool } type Writer interface { @@ -189,7 +190,9 @@ func (d *Document) parseOne(i int, stop stopFn) (consumed int, node Node) { if consumed != 0 { return consumed, node } - log.Printf("Could not parse token %#v: Falling back to treating it as plain text.", d.tokens[i]) + if d.Debug { + log.Printf("Could not parse token %#v: Falling back to treating it as plain text.", d.tokens[i]) + } m := plainTextRegexp.FindStringSubmatch(d.tokens[i].matches[0]) d.tokens[i] = token{"text", len(m[1]), m[2], m} return d.parseOne(i, stop)